Showing posts with label Pointers. Show all posts
Showing posts with label Pointers. Show all posts

Monday, 1 December 2014

Pointers in Php

Structure of the Problem Requirements 

Pointers are used to find the Memory address of the variables in Php.Pointers are also variables which hold the memory address instead of values. In Programming and complex Data Structures Pointers are used to Pass Value by Reference.Hope you will get a clear concept about Pointers in this Tutorial.

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>

OUTPUT OF THE PROGRAM

Pointers in Php
Pointers in Php