Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. /^_+$/
  2.  
  3. if (strspn($str, '_') == strlen($str)) {
  4. // only underscores
  5. }
  6.  
  7. if( !preg_match("/[^0-9a-z_]/si", $string) && trim($string,"_")!=""){
  8. // Code here
  9. }
  10.  
  11. if( trim($string,"_")=="") ){ /* _ only */ }
  12. if( str_replace("_", "", $string)=="") ){/* _ only */}
  13. if( !preg_match("/^_/si", $string) ){/* _ only */}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement