Jump to content

Recommended Posts

@thebadbad:

 

i tried applying that solution but there's an affected script and wont work... but when i tried applying str_replace it's working...

 

so i thought that i can apply htmlentities inside str_replace but i don't know how to do it.

 

 

but there's an affected script and wont work

 

Huh? Do you mean that you only want to convert certain characters, like < and >? Using str_replace():

 

<?php
$val = str_replace('<', '<', $val);
$val = str_replace('>', '>', $val);
?>

If that's not what you want, please explain your problem better.

Well, htmlentities() converts all applicable characters. What went wrong when using htmlentities()? If you've got a set of characters you want to convert, just run them through str_replace():

 

<?php
$replace = array(
'<' => '<',
'>' => '>',
'"' => '"'
//...
);
$str = str_replace(array_keys($replace), $replace, $str);
?>

not using it because i'm just using a ready made script and when using htmlentities() it cause a problem on xajax.

 

but when i applied str_replace() the problem didn't occured.

 

just finding a solution to convert all of the html entity into their respective value and put it in str_replace() just like THEBADBAD solution.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.