Foreach loop


#1

<?php
$yardlines = array("The 50... ", "the 40... ",
"the 30... ", "the 20... ", "the 10... ");

    foreach($yardlines as $items){

    echo "touchdown!";
    }

its shows did'nt echo the "the50...

why?


#3

It won't out echo any item from the array $yardlines unless you echo out the $items variable. Like this

 <?php

    $yardlines = array("The 50... ", "the 40... ","the 30... ", "the 20... ", "the 10... ");

    foreach($yardlines as $items){

        echo $items."touchdown!<br>";
    }

?>

#4

yeah i got that thanks but i have more issues in fuctions strings can i
show then u can help me find out the problem??


#5

Yeah sure, no problem.


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.