forum php syntax
<?php
any chance of releasing
the code for the php syntax
used on these forums, i
would be eternally gratefull
?>
<?php
any chance of releasing
the code for the php syntax
used on these forums, i
would be eternally gratefull
?>
Mark Hensler posted this at 23:31 — 25th June 2003.
He has: 4,048 posts
Joined: Aug 2000
I can't release code from this forum software. But what you are looking for is highlight_string().
spor posted this at 10:04 — 26th June 2003.
He has: 207 posts
Joined: Apr 2003
ok, thankyou for that pointer. appreciated.
<?php
function color_source($string){
$array_contenido = explode(\"[php]\",$string);
$final = $array_contenido[0];
for($i = 1;$i <= count($array_contenido);$i++){
$array_contents = explode(\"[php]\",$array_contenido[$i]);
ob_start();
highlight_string($array_contents[0]);
$array_contents[0] = ob_get_contents();
ob_end_clean();
$final .='
<font face=\"Courier new, Courier, Mono\" size=3>'.$array_contents[0].\"</font>
\".$array_contents[1];
}
return $final;
}
?>
I think thats what im looking for (had to leave out the closing slash for it to display here.)
Cymru am byth
spor posted this at 16:54 — 26th June 2003.
He has: 207 posts
Joined: Apr 2003
the next version of phpbb will have this.so i might as well wait as it wont be too far off. thanks for your help though.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.