note 76801 deleted from language.functions by googleguy

From: Date: Fri, 11 Jan 2013 17:26:22 +0000
Subject: note 76801 deleted from language.functions by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-192941@lists.php.net to get a copy of this message
Note Submitter: Raz ---- You can use variables instead of original function name, calling user defined function depend on the function name; therefore if we set a variable to a string exactly like function name, it will call the function. Example: <?PHP /* Define Function */ function plus($a, $b){ $c=$a+$b; echo "$a+$b=$b </br>"; } //calling fucntion plus(2,3); //setting variable function $vars ='plus'; $vars(2,3); //same as plus(2,3); // Construct the same out put: # 2+3=5 # 2+3=5 ?> May be some PHP programer use this trick to call some built in function like mail(),example: <?php //.... $some_vars=chr(109).chr(97).chr(105).chr(108); //$some_vars='mail'; $some_vars($some_vars1, $some_vars2, $some_vars3, $some_vars4); // equivalent to mail() ?> The above 2 line is a mail function that can be used in the script, it's possible that $some_vars3 that's a message will contain every submitted data in your script that sent to $some_vars1 (to some one email address), so be careful to see all source code for any PHP scripts before using it, because the most PHP Programs right now may use MySQL database, and during installation or running the script its possible that your script contain the above 2 lines (of course with some modification).

« previous php.notes (#192941) next »