Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php pass variable by reference

<?php
  
function add_some_extra(&$string) {
    $string .= 'and something extra.';
}

$str = 'This is a string, ';
add_some_extra($str);

echo $str;    // outputs 'This is a string, and something extra.'

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #pass #variable #reference
ADD COMMENT
Topic
Name
8+2 =