Answers for "<?= in php"

PHP
1

$$ 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
0

-> in php

// Create a new instance of MyObject into $obj
$obj = new MyObject();
// Set a property in the $obj object called thisProperty
$obj->thisProperty = 'Fred';
// Call a method of the $obj object named getProperty
$obj->getProperty();
Posted by: Guest on December-01-2020
-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