Web Hosting Deals Holiday Logo Design Webcam Chat Website Header Templates Register domain Search Engine Optimisation Web Hosting
Go Back   Talk Mania Forum > Programming / Scripting / Coding

Programming / Scripting / Coding Got a question about : PHP / Perl / Java / JavaScript / CGI Scripts / JavaScript coding. Ask here! We'll get you the answers !

 Image
Buy Sell Downloads

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2007, 04:15 PM
Senior Member
 
Join Date: May 2007
Posts: 181
Blog Entries: 1
skyfe is on a distinguished road
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;
?>
Then my outcome shows:
= "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>";
?>
EDIT2: doesn't work again!!

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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +2. The time now is 07:19 PM.


Fake ID

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC8
Forums Copyright © Talk-Mania.com