Answers for "what is .= in php"

PHP
1

what does $ sign mean in php

<?php

$name = "World";
echo "Hello, $name";

# $ i.e. "sigil" is used to distinguish a string variable from rest of the string.
Posted by: Guest on September-25-2020
2

$$ in php

$x = "abc";  
$$x = 200;  
echo $x."<br/>";  
echo $$x."<br/>";  
echo $abc; 

// output:
abc
200
200
Posted by: Guest on July-27-2021
-2

?? ' ' in php

// Null Coalesce Operator - $statement ?? ''
$categoryName = $category->name ?? 'Not Available';

// The above Statement is identical to this if/else statement
if (isset($category->name)) {
    $categoryName = $category->name;
} else {
    $categoryName  = 'Not Available';
}
Posted by: Guest on February-16-2021

Browse Popular Code Answers by Language