Re: Problems with arrays

From: Date: Thu, 17 Jun 2004 13:53:55 +0000
Subject: Re: Problems with arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-188484@lists.php.net to get a copy of this message
echo "$InputString" . '<BR>'; // for HTML echo "$InputString\n"; // for output to screen >>Hi, >> >>I have this array: >> >>$array = array(element1, element2, element3, element4) >> >>I want to list all elements of this array, so i used: >> >> foreach ($array as $index => $element) { >> $InputString = "$element"; >> echo "$InputString"; >> } >> >>but this code lists the elements like this: element1 element2 element3 element4 >> >>How can i list my elements like this: >>element1 >>element2 >>element3 >>element4 >> >> >>Thanks >>

« previous php.general (#188484) next »