Skip to content

PHP code snippet – How if charactor is exist in text in laravel?

 $str_contains = $request->birthDay;
if(str_contains($request->birthDay , '-')){
  return 'this text contains "-" charactors';
}elseif(str_contains($request->birthDay , '/')){
  return 'this text contains "/" charactors';
}
See also  Python code snippet - How to create empty class?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.