PHP str_replace not replacing quotes -


hello have following code witch scans string , suppose replace double quotes ". problem finds double quotes, replaces them " adds " end of it. dosnt replace quote. dont understand im doing wrong. here code:

        $lineocc31 = substr_count($text, '"');          if($lineocc31 < '1'){             $text = $text;         }else{             $text = str_replace('"', '&quot;', $text);         } 

$string = 'something " in it'; echo htmlentities($string); 

output: &quot; in it

see here https://3v4l.org/afrni


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -