String matches : String Matches : String PHP Source Code


PHP Source Code » String » String Matches »

 

String matches




<?php
     $pattern = "/^PHP$/";
   
     $string = "   PHP   ";
     if(preg_match($pattern, $string)){
          print("Found a match!");
     }
     
     $string = "PHP is ";
     if(preg_match($pattern, $string)){
          print("This line won't print!");
     }     
?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo String
» String Matches