Replace use of explode() with str_split()
Posted
by user289346
on Stack Overflow
See other posts from Stack Overflow
or by user289346
Published on 2010-03-09T04:08:35Z
Indexed on
2010/03/09
4:21 UTC
Read the original article
Hit count: 428
$transData = fgets($fp);
while (!feof ($fp))
{
$transArry = explode(" ", $transData);
$first = $transArry[0];
$last = $transArry[1];
$Sub = $transArry[2];
$Grade= $transArry[3];
echo "<table width='400' ><colgroup span='1' width='35%' /><colgroup span='2' width='20%' /> <tr><td> ".$first." ".$last." </td><td> ".$Sub." </td><td> ".$Grade." </td></tr></table>";
$transData = fgets($fp);
}
My teacher wants me to change this use of explode()
to str_split()
while keeping the same output. How do I do this?
© Stack Overflow or respective owner