Pointers are used to find the Memory address of the variables in Php. Pointers are also variables that hold the memory address instead of values. In Programming and complex Data Structures Pointers are used to Pass Value by Reference.
Source Code
<html> <head> <title>Pointers in Php</title> </head> <body> <?php // Pointers and while loops revisited $Numbers = array(1, 2, 3, 6, 12, 23); ?> <?php echo "1: " . current($Numbers) . "<br />"; next($Numbers); echo "2: " . current($Numbers) . "<br />"; reset($Numbers); echo "3: " . current($Numbers) . "<br />"; ?> <br /> <?php while ($age = current($Numbers)) { echo $age . ", "; next($Numbers); } ?> </body> </html>
0 comments:
Post a Comment