loki951510 Posted November 6, 2009 Share Posted November 6, 2009 hi all dont know if you can help im trying to remember how to do this i have a program what out puts the data like this The Fortress of the Aesir|xxxxxxx|Licat volare si super tergum Aquila volat.|14|0|United Kingdom| but i cant for the life of me remember how to make the php but each bit into a didnt box on a web page can someone plz help me Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 6, 2009 Share Posted November 6, 2009 depends what you want to do with this data, your post is very vague Quote Link to comment Share on other sites More sharing options...
loki951510 Posted November 6, 2009 Author Share Posted November 6, 2009 what it to out put into columns like name address description users share location Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 6, 2009 Share Posted November 6, 2009 there are many was to do this <?php $str = "The Fortress of the Aesir|xxxxxxx|Licat volare si super tergum Aquila volat.|14|0|United Kingdom|"; $str = preg_replace('#|$#', '', $str); print "<table border='1'>"; print "<tr><td>Name</td><td>Address</td><td>Description</td><td>Users</td><td>Share</td><td>Location</td></tr>"; call_user_func_array('printf', array_merge(array("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>"), explode("|", $str))); print "</table>"; ?> or a simpler way to understated <?php $str = "The Fortress of the Aesir|xxxxxxx|Licat volare si super tergum Aquila volat.|14|0|United Kingdom|"; $str = preg_replace('#|$#', '', $str); list ($name, $address, $desc, $users, $share, $location) = explode('|', $str); echo "<table border='1'>"; echo "<tr><td>Name</td><td>Address</td><td>Description</td><td>Users</td><td>Share</td><td>Location</td></tr>"; echo "<tr><td>$name</td><td>$address</td><td>$desc</td><td>$users</td><td>$share</td><td>$location</td></tr>"; echo "</table>"; ?> and many other ways too Quote Link to comment Share on other sites More sharing options...
loki951510 Posted November 6, 2009 Author Share Posted November 6, 2009 this data is held in a diffent file as its updated all the time so it needs to be pulled out of the other file to be added into the main file The Fortress of the Aesir|xxxxxxx|Licat volare si super tergum Aquila volat.|14|0|United Kingdom| Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.