php判断字符串A是否含有字符串B

<?php
if (preg_match ("/PHP/", "PHP is the web scripting language of choice.")) {
   print "A match was found.";
} else {
   print "A match was not found.";
}
?>

 

posted @ 2013-06-28 09:37  神马和浮云  阅读(357)  评论(0编辑  收藏  举报