PHP Programing language

Write a Program to Return the current element in an array
Previous Home Next
<html>
<head>
<title>Return the current element in an array</title>
</head>
<body>
<?php
$city = array("Allahabad", "Kanpur", "NewDelhi");
print_r($city );
$city  = current($city ); // returns "Allahabad"
echo "City:$city<br />";
$city = next($city); // returns "Kanpur"
echo "City: $city<br />";
$city = prev($city); // returns "NewDelhi"
echo "City: $city<br />";
?>
           
</body>
</html>

 

Output:

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: