Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. if (strpos($str, '1 minute') !== false)
  2. {
  3.  
  4. }
  5.  
  6. $string = "Lorem ipsum 51 Minutes on StackOverflow";
  7. $regex = "/b1 Minuteb";
  8.  
  9. $match = preg_match( $string, $regex );
  10.  
  11. if(strpos($haystack, $needle) !== false) {
  12. // do something here
  13. }
  14.  
  15. $string = '51 Minutes';
  16. $needle = '1 Minute';
  17.  
  18. preg_match(
  19. '/^' . $needle . '$/',
  20. $string,
  21. $matches
  22. );
  23.  
  24. if ($matches[0])
  25. {
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement