/* EXAMPLE: <p>Bed & Breakfast</p> --> <p>Bed & Breakfast</p>
& &
" " (unless ENT_NOQUOTES is set)
' ' or ' (ENT_QUOTES must be set)
< <
> > */
<?php
$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);
echo $new; // <a href='test'>Test</a>
?>
function removeSpecialChar($string)
{
$string = strtolower($string);
$string = preg_replace('/[^da-z ]/i', '', $string);// Removes special chars.
$string = str_replace(' ', '-', $string); // Replaces all spaces with underscore.
return strtolower($string);
}
Code Example |
---|
Php :: how to show image in laravel |
Php :: Get wordpress posts by category name..! |
Php :: strict types php |
Php :: create multiple session in php |
Php :: how to get structure of table in codeigniter |
Php :: php include |
Php :: password_verify php |
Php :: get current day php |
Php :: get node id in twig drupal |
Php :: php hello world program |
Php :: what does defined di in php |
Php :: Termlaravel validation exists array rules |
Php :: Change WordPress Login Logo Url |
Php :: php string search in array |
Php :: E: Unable to locate package php7.2-fpm |
Php :: acf create post with fields |
Php :: img upload in php |
Php :: unique key value array php |
Php :: composer autoload |
Php :: php if short form |
Php :: create array php |
Php :: phpunit test private function |
Php :: rawbetween in laravel |
Php :: php sort() |
Php :: Laravel Adding Cookie Consent |
Php :: get cookie in laravel |
Php :: if user name is wordpress |
Php :: laravel blade components |
Php :: calculate array length in php |
Php :: aws sdk php |