QUOTE(Eltrusko @ 9 May, 2008 - 02:05 AM)

QUOTE(MitkOK @ 8 May, 2008 - 11:32 AM)

to view a source code....it works fine...
but how should i use it..to convert it as a text file.....???
i have written code depicted below.....but it does not work any more....
actually i m doin my project on "Web page Publication " which is just like as
Microsoft office publisher and geocities.com web hosting.....thats why i need
to insert cms and this one.
by da way......the code:-
CODE
<?php
function highlight_with_linenum($file)
{
//open handle, set vars
$handle = fopen($file, "r");
$count = 1;
$lines = "";
//look line ends
while ($thisone = fread($handle, "1"))
{
if ($thisone == "\n")
{
//add number
$lines .= $count . "<br />";
$count++;
}
}
//close handle
fclose($handle);
//highlight contents
$contents = highlight_file($file, TRUE);
//print output (you could as well return now)
$soumen_file=fopen("h.txt","w+");
chown("h.txt","charles")
$len=strlen($content);
$len1=0;
while($len1!=$len)
{
$len1=$len+1;
gets("$content");
puts("h.txt","a+");
}
fclose($soumen_file);
//echo "Succesfully copied in txt file","h.txt";
//copy('$contents','h.txt');
fclose($soumen_file);
// print '<table><tr><td><code>' .
// $lines . '</code></td><td>' .
// $contents . '</td></tr></table>'
}
highlight_with_linenum("yourpage_prj_goin.php");
?>
plz reply