Answers for "find special characters from string php"

PHP
0

determine special characters in php

<?php

$string = 'foo';

if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬-]/', $string))
{
    // one or more of the 'special characters' found in $string
}
Posted by: Guest on October-13-2020
0

special characters in php

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);
		}
Posted by: Guest on December-27-2021

Code answers related to "find special characters from string php"

Browse Popular Code Answers by Language