Answers for "string contains special characters 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
1

php preg_match special characters

$string="sadw$"
  if(preg_match("/[\[^\'£$%^&*()}{@:\'#~?><>,;@\|\\\-=\-_+\-¬\`\]]/", $string)){
   //this string contain atleast one of these [^'£$%^&*()}{@:'#~?><>,;@|\-=-_+-¬`] characters
  }
Posted by: Guest on June-11-2021

Code answers related to "string contains special characters php"

Browse Popular Code Answers by Language