電腦滑鼠細菌數
是馬桶400倍
搬家專業居家清潔
免費到府估價,清潔養護馬上搞定

首頁  •  j2h 論壇 • 程式設計討論     • 

[php] 陣列比對

房東:小蛙
發表時間:2016-01-16
[檢舉]




//////資料比對
$haystack = array (
\'say hello\',
\'hello stackoverflow\',
\'hello world\',
\'foo bar bas\'
);

/////關鍵字
$keyword=\"hello\";



if (preg_grep (\"/$keyword/i\", $haystack)) {
echo \"條件符gggg合
\";
} else {
echo \"條件不符gggg合
\";
}


$matches = preg_grep (\"/$keyword/i\", $haystack);
print_r ($matches);


?>



  • 贊助網站       

    廣利不動產-新板特區指名度最高、值得您信賴的好房仲
    您的托付,廣利用心為您服務
    廣利不動產-板橋在地生根最實在--新板特區指名度最高、值得您信賴的好房仲
    完整房訊,房屋、店面熱門精選物件,廣利不動產 優質仲介,房屋租賃、買賣資訊透明,交易真安心!

  • 1 樓住戶:jack
    發表時間:2016-01-19
    [檢舉]

    $array1 = array('html','php','js','css');
    $array2 = array('php','python','html','java');

    $result = array_intersect($array1, $array2);
    print_r($result);

    the result is:

    Array
    (
    [0] => html
    [1] => php
    )




     共 1 人回應  選擇頁數 【第1 頁】 

    姓名:
    佈告內容: