what is &$ used for in php code example
Example 1: php pass by reference
<?php
function appendToString(&$string)
{
$string .= 'Cool Im appended';
}
$str = 'I am a start and - ';
appendToString($str);
echo $str; // outputs 'I am a start and - Cool Im appended'
?>
Example 2: 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.