Forum Moderators: coopster
I'm facing this strange problem with foreach. I have built a site on my local system (Win XP, Apache2, PHP 4.3.10) and "foreach" loop works fine.
e.g
$a = array("1-2","2-4","4-2");
foreach ($a as $v)
echo $v;
this runs fine on my local system and prints
1-22-44-2
but when i run this same script on the remote server (Linux, Apache2, PHP 4.3.10) it prints
ArrayArrayArray
did anyone else here ever had this problem....?..please help!
zeeshan.
I have tried using this
foreach($a as $key=>$v)
echo $v;
and it works fine but that means i'll have to change all my php files and put this new "foeeach" code in them and its gonna take a long time since i'ev got alot of files n i'ev used foreach in almost all of them..
I'm wondering why isnt it working fine on the remote server when the versions on Apache and PHP are the same as my local server.
[webmasterworld.com...]