CodeIgniter Forums
Proplem with special characters - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25)
+--- Thread: Proplem with special characters (/showthread.php?tid=72495)



Proplem with special characters - Germanikus - 12-30-2018

Hello, everybody,
I have a problem with the special characters.
I would have to make many entries with an array and there are special characters like this " and ' with it.
If I put this in an input like this, it will be displayed.
Code:
<input type="text" class="form-control" placeholder="" value="&quot;A&quot; Cell Incubator">


But if I use a "str_replace" to help, nothing is displayed.

PHP Code:
<?php
    $suche        
= array("&quot;");
    
$ersetze    = array('"');
    
$text        "&quot;A&quot; Cell Incubator";
    
$texts        "&quot;A&quot; Cell Incubator";
?>
<ul class="">
    <li><h1>Sonderzeichen "</h1>
        <ul class="">
            <li><?php echo str_replace($suche$ersetze$text); ?></br>
                <input type="text" class="form-control" placeholder="" value="<?php echo str_replace($suche$ersetze$text); ?>"></li>
        </ul>
    </li>
</ul> 


My goal is to display the HTML code for special characters in the input.


RE: Proplem with special characters - ragingTorch - 12-31-2018

Hi,

Try this: https://www.codeigniter.com/user_guide/helpers/form_helper.html#escaping-field-values