Answers for "php pass by reference"

PHP
7

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'
?>
Posted by: Guest on July-12-2019

Code answers related to "php pass by reference"

Browse Popular Code Answers by Language