Re: Newbie array problem
| From: | Kevin Waterson | Date: | Thu, 23 Sep 2004 10:33:51 +0000 |
| Subject: | Re: Newbie array problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197660@lists.php.net to get a copy of this message | ||
This one time, at band camp, "Phpu" <phpu@go.ro> wrote:
> If i have an array
> $array = array(1, 2, 3, 4, 5, 6, 7)
> How can i display the array element sepparated by (;) like this
> $display = 1;2;3;4;5;6;7
$i=0;
$arraySize = sizeof($array);
while($i < $arraySize){
echo $array[$i];
if($i < ($arraySize-1)){
echo ';';
}
$i++;
}
Kevin
---------
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."