Ryuujin Posted November 23, 2007 Share Posted November 23, 2007 Hey guys, I have this script: <?php $str = file_get_contents("csvranks.html"); $pieces = explode(',', $str); echo "<table border='1'><tr><td>".$pieces[0]."</td><td>".$pieces[1]."</td><td>".$pieces[2]."</td><td>".$pieces[3]."</td><td>".$pieces[4]."</td></tr></table>"; ?> And this page as an output: http://www.ryu.kxs.in/MRC/test.php Now, look at the last table cell, where it has the space. Well, I want that removed and put into a NEW array. Any idea how I can separate the words when it runs into "," and spaces? Thanks guys! Link to comment https://forums.phpfreaks.com/topic/78618-solved-explode-help/ Share on other sites More sharing options...
cooldude832 Posted November 23, 2007 Share Posted November 23, 2007 explode(" ",$pieces[4]); Link to comment https://forums.phpfreaks.com/topic/78618-solved-explode-help/#findComment-397806 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.