Plz Help me its urgnt to me array handling

[php]$arr=$_POST[‘block’][/php]

when i exe this line i get output like this

339,341,343,347
wen i echo this

[php]echo $arr[0];
echo $b=$arr[0];
echo $c=$arr[1];
echo $d=$arr[2];
echo $f=$arr[3];
[/php]

i get out put
3
3
9
,

i want to split the values

339,341,343,347

as
339
341
343
347

Plz help me and tell me how to split this array

I got these values through J query these a r values of unchecked check boxes i got by using query code
now i m confuse how to handle it.
there numbers r identity values i need to handle them as int values these r dynamic from database so i cannot guess wht id is going on.

Maybe its a two dimensional array. :slight_smile:

And use intval($string) to convert string into int value.

Example:
[php]

<?php $string="123"; $integer=intval($string); echo $integer; ?>

[/php]

Also,
if this is the string “339,341,343,347”

Then use explode function
explode($string,$xplode); /*here $xplode=’,’ */

After using explode function, use pregmatchall with integer class to extract integers and then use intval after pregmatch all.

Note: There should be no other chrachter in intval function other then integers.

yes i have already solved thnks for reply

Sponsor our Newsletter | Privacy Policy | Terms of Service