What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Generating and displaying a PHP array as a table?

Generating and displaying a PHP array as a table?
Author: Message:
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Generating and displaying a PHP array as a table?
quote:
Originally posted by Jimbo
Also, would there be a way to sort by immunity, descending?
there is but i cant think of a way to do it at the moment...

php code:
<?php

$file = './path/to/file.ext';

preg_match_all('/"([^"]*)"\n\s*\{\n\s*"auth"\s*"([^"]*)"\n\s*"identity"\s*"([^"]*)"\n\s*"group"\s*"([^"]*)"\n\s*"immunity"\s*"([^"]*)"/',str_replace("\r\n","\n",file_get_contents($file)),$matches);

echo '<table border="1px solid #000">';
for($i=0;$i<count($matches[0]);$i++){
    echo '<tr>';
    echo '<td>'.$matches[1][$i].'</td>';
    echo '<td>'.$matches[2][$i].'</td>';
    echo '<td>'.$matches[3][$i].'</td>';
    echo '<td>'.$matches[4][$i].'</td>';
    echo '<td>'.$matches[5][$i].'</td>';
    echo '</tr>';
}
echo '</table>';

?>
08-24-2009 10:52 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Generating and displaying a PHP array as a table? - by Jimbo on 08-23-2009 at 10:54 PM
RE: Generating and displaying a PHP array as a table? - by NanaFreak on 08-24-2009 at 07:35 AM
RE: Generating and displaying a PHP array as a table? - by Jimbo on 08-24-2009 at 09:57 AM
RE: Generating and displaying a PHP array as a table? - by NanaFreak on 08-24-2009 at 10:42 AM
RE: Generating and displaying a PHP array as a table? - by Jimbo on 08-24-2009 at 10:49 AM
RE: Generating and displaying a PHP array as a table? - by NanaFreak on 08-24-2009 at 10:52 AM
RE: Generating and displaying a PHP array as a table? - by Jimbo on 08-24-2009 at 11:01 AM
RE: Generating and displaying a PHP array as a table? - by Felu on 08-24-2009 at 01:20 PM
RE: Generating and displaying a PHP array as a table? - by Jimbo on 08-24-2009 at 01:48 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On