Forum Moderators: coopster

Message Too Old, No Replies

Ready Made PHP File

         

Gian04

9:59 am on Aug 21, 2007 (gmt 0)

10+ Year Member



A friend send me a PHP filewhich I find really useful but the file is in this format:

<?php
$catColors[0][0]="#999900";$catColors[3][1]="#ffcc66";$catSp="7";function templateMain($userMenuStr,$adminMenuStr,$userStatus,
$navBarText,$infoText,$gorumcontent,$footer){global $xi;

I khow there is a website (which I cant remember now) where after pasting the code to a textbox, it will format the code to a readable format something like this:
------------------------------------------------
<?php
$catColors[0][0]="#999900";
$catColors[3][1]="#ffcc66";
$catSp="7";
function templateMain($userMenuStr,$adminMenuStr,$userStatus,
$navBarText,$infoText,$gorumcontent,$footer)
{
global $xi;
------------------------------------------------

Can someone point me to that site, please if its not allowed to post URL here, please PM me, thanks.

jatar_k

12:14 pm on Aug 21, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could save the file, then use a script to do it

<?
$contents = file_get_contents('yourfilename.ext');
$newcontents = str_replace(';',";\n",$contents);
$fp = fopen('newfilename.ext','w');
fwrite($fp,$newcontents);
fclose($fp);
?>

might be write, just wrote it off the top of my head

then open the new file and see if it worked

vincevincevince

6:47 am on Aug 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The product you are looking for is a PHP source indenter / formatter - a quick search should find you one.