Loading...

PHP查詢陣列中是否存在特定字串in_array() 函數

Temperature: 0 °C

Mark ChangMark Chang
author_tools

使用函數in_array() ,適用版本(PHP 4, PHP 5, PHP 7, PHP 8)
使用方式:in_array("字串", 陣列)。
範例:

$newarr = array("google", "yahoo", "twitter", "inn");
if (in_array("inn",$newarr)){
echo "搜尋字串存在陣列中";
}else{
echo "搜尋字串不存在陣列中";
}

以上紀錄~

#故事  #inarray  #PHP  
https://innstory.com/story-PHP查詢陣列中是否存在特定字串inarray_函數-2979
PHP

Prev
 使用手機將網址分享到_Line時如何強制使用預設外部瀏覽器開啟

Next
要如何修改Plesk空間上傳檔案大小的限制 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

PHP–implode() 將陣列轉成字串

PHP–implode() ...

pexelsphoto 使用implode將陣列轉換成字串; $ar=array(&#;a&#;,&...

PHP輸出到WORD跟EXCEL 簡易做法

PHP輸出到WORD跟EXC...

pexelsphotooffice WORD: $filename="test.doc&q...

破版,很醜!!

破版,很醜!!

pexelsphotowrite5 破版......很醜對不對!! 我想這是所有從事網頁設計師的痛~...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format