Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: htmlentities

  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    htmlentities

    I have the follow code:

    PHP Code:
    echo "<base target=\"_blank\" /><font face=\"arial\" size=\"2\">\r\n";
    echo 
    "<meta http-equiv=Content-Type content=text/html; charset=utf-8 />";
    echo (
    htmlentities($NoteBook)); 
    This code converts the special characters to format html. My problem is that the tags html (example <img src = "">) also are converted them and what I want only convert special characters but not the tags of html. I wait your help. Regards

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,858
    Thanks
    22
    Thanked 157 Times in 148 Posts
    Why does it matter if the html syntax is converted? You can always decode the string with html_entity_decode() ...either way, the HTML will still render correctly in your browser...
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Can you tell me How I can apply? Regards

  • #4
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,858
    Thanks
    22
    Thanked 157 Times in 148 Posts
    Not really sure what you are doing, but:
    PHP Code:
    $output =  "<base target=\"_blank\" /><font face=\"arial\" size=\"2\">\r\n"
    $output .= "<meta http-equiv=Content-Type content=text/html; charset=utf-8 />"
    $encoded_output  =  htmlentities($output); 
    That encodes the string....

    PHP Code:
    echo html_entity_decode($encoded_output); 
    ...and that decodes the string...
    Last edited by chump2877; 08-27-2006 at 05:30 AM.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #5
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Not really sure what you are doing, but:
    I try to respect the tags HTML and the special characters. If a user puts <img src="hola.gif"> this is showed in format html and is not converted to plain text. The same thing I want for the special characters as: &#228;, &#225;, &#209; and others that users of other countries use. Regards
    Last edited by urgido; 08-27-2006 at 07:01 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •