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:
Jimbo
Veteran Member
*****

Avatar

Posts: 1650
Reputation: 18
32 / Male / Flag
Joined: Jul 2006
O.P. RE: Generating and displaying a PHP array as a table?
Thanks, for some reason though, its now only displaying some entries. The php I am using:
php code:
<?php

$file = 'admins.cfg';

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>';

?>
Website the table is being displayed on: http://66.90.103.33/website/admins.php

And I shall PM you a link to "admins.cfg"

Also is there any way to make those characters that arent working appear? I tried setting the php page to utf-8, but it still displayed them as that question mark.


This post was edited on 08-24-2009 at 11:10 AM by Jimbo.
08-24-2009 11:01 AM
Profile E-Mail 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