ragib
1
Hi,
I have array(info) which contain value separated by @.
info Array ( [0] => 1@1@2011-09-06 [1] => 61@11@2001-01-01 [2] => 781@13@2001-01-01 )
and my php function contain following
for($j=0;$j<count(info);$j++)
{
$value=$info[$j];
$rowval=explode('@',$value);
echo $id=$rowval[0];
}
it should print 1,61,781. it is printing noting. It does not make any sense!
Please help.
system
2
Yeah,I was going to point out that you had no $ on count(info) … glad you got it sorted.
Some advice though – it’s an array, use foreach.
What does
# DEVELOPMENT + DEBUGGING
error_reporting(E_ALL);
ini_set('display_errors', true);
.....
echo count(info);
give you?
ragib
4
Hi,
fixed . Thanks Mittineague .for remind me to turn on error reporting.
It was wrong variable &loop issue.
Hmmm. try
for($j=0;$j<count(info);$j++)
{
var_dump($info);//for debugging only
$value=$info[$j];
var_dump($value);//for debugging only
$rowval=explode('@',$value);
echo $id=$rowval[0];
}