Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php pass byref

<?php
  
// Declair function assigns a new value to 
// $string variable and prints it
  function return_string( &$string ) {

    //build return string var
    $return_the_string = $string . "- returned STRING";

    //modify the string var
    $string = $string . "- passed byREF";

    // you could print or return the string aswell
    //print( $string );
    return $return_the_string ;
  }

// EXAMPLE 1 ----------------------
  $string = "1-Input string ";

  return_string( $string ); //call function

  print( $string ); //print string with new text

# EXAMPLE 1 OUTPUT:
  # 1-Input string - passed byREF 


// EXAMPLE 2 ----------------------
  $string = "2-Input string ";

  $returned_string = return_string( $string ); //call function

  print( $string); //print string with new text
  print( $returned_string ); //print string with new text

  # EXAMPLE 2 OUTPUT:
    # 2-Input string - passed byREF
    # 2-Input string - returned STRING

?> 
Comment

PREVIOUS NEXT
Code Example
Php :: movies -inurl:(htm|html|php|pls|txt) intitle:index.of “last modified” (mp4|wma|aac|avi) 
Php :: validation.required laravel 
Php :: myr currency symbol 
Php :: enset laravel session 
Php :: Code début Selenium PHP 
Php :: what is laravel framework 
Php :: php slots 
Php :: laravel email forgot password 
Php :: how get end of array in foreach php 
Php :: woocommerce php same skus 
Php :: Protect Your Site from Malicious Requests 
Php :: laravel session wont update 
Php :: laravel count soft delete data 
Php :: rename matomo php 
Php :: laravel request 
Php :: php?gs=3 
Php :: Header requirements for new plugin in wordpress 
Php :: $name = $name; "Robert" echo; 
Php :: mongodb uploading csv php 
Php :: codeigniter email validate and dublicate from database in php 
Php :: laravel read csv 
Php :: King Composer Theme Export 
Php :: $order- date 
Php :: jquery ui sortable tables php mysql 
Php :: create newfilter wordpress 
Php :: how to execute a php script from the command line? 
Php :: Comment supprimer les avis sur les produits de votre boutique WooCommerce 
Php :: calculate age from date of birth php 
Php :: woo can not change products perpage in shop page 
Php :: laravel get referer without host 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =