0% found this document useful (0 votes)
14 views1 page

Foreach Loop in PHP

Uploaded by

SANJEET KUMAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Foreach Loop in PHP

Uploaded by

SANJEET KUMAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

foreach loop in php

<?php

$book=array("C by Danish Rithchy","C++ by Balaguruswami","java by ravichandran");

foreach($book as $value)

echo "$value <br>";

?>

Iteration Value/array element output


1st iteration C by Danish Rithchy C by Danish Rithchy
2nd iteration C++ by Balaguruswami C++ by Balaguruswami
3rd iteration java by ravichandran java by ravichandran
4th iteration No new value found

output:

C by Danish Rithchy
C++ by Balaguruswami
java by ravichandran

You might also like