PHP - reference example

1:       $str = "parklize";  
2:       $new_str = &$str;  
3:       unset($str);  
4:       echo $new_str;  

The sentence in line2 means that $new_str and $str are pointing to the same place, so even while $str is unset, we could access the variable value by using $new_str.

No comments:

Post a Comment