|
| Web Hosting Deals | Holiday Logo Design | Webcam Chat | Website Header Templates | Register domain | Search Engine Optimisation | Web Hosting |
|
|||||||
| Programming / Scripting / Coding Got a question about : PHP / Perl / Java / JavaScript / CGI Scripts / JavaScript coding. Ask here! We'll get you the answers ! |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
function nl2br and highlight_string
Hello,
I'm having the following problem with these 2 functions: when I'm using this on a php string, it doesn't really showing only the code. Example: I try this: Code:
<?php $string = "<?php $test = "Hallo"; ?>"; $show_code = nl2br($string); //or: $show_code = highlight_string($string); echo $show_code; ?> = "Hallo"; it doesn't shows the "$test", but the value of $test(nothing)... so it doesn't shows the code correctly, but parts it just run as an php code instead of a string of text... Can anyone help me with this? Thanks in advance, skyfe. EDIT: fixed It has to be:Code:
<?php echo "<pre>".highlight_string($string)."</pre>"; ?> ![]() EDIT3: IT WORKS XD it should be between 'and ' instead of " and ", caus else it though it should be a php code, instead of a string/text Last edited by skyfe; 06-23-2007 at 04:58 PM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|