Convert Comma Separated String into Array
Easy way to turn a CSV file into a parseable array.
<?php
$str="foo,bar,baz,bat";
$arr=explode(",",$str);
// print_r($arr);
?>
Easy way to turn a CSV file into a parseable array.
<?php
$str="foo,bar,baz,bat";
$arr=explode(",",$str);
// print_r($arr);
?>
Is there a way to take a comma separated string like say:
Tags: Something, somethingelse, thirdsomethingintoTags:
Something
Somethingelse
thirdsomething
Perhaps by wrapping this code
Tags: Something, somethingelse, thirdsomethingin some kind of div? Is this possible?Thank you very much,
Ok, but if i put the $arr in a cycle for example “for”…how can i kmow the lenght of that array?…the problem for me it’s that one…the cycle should print $arr[0],$arr[1],$arr[2],$arr[3] and then stop, how can i tell it the it has to stop on number three?