Jump to content

help with phashing file out puts


loki951510

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.