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

判斷字串是否存在於內容中

判斷字串是否存在於內容中

searchphoto5 以下範例~ 搜尋 If you are lucky enough to b...

Format JavaScript Date to yyyy-mm-dd

Format JavaScr...

timecalendar5 JavaScript將Sun May ,轉換成yyyymmdd func...

javascript change css class

javascript cha...

javascript 使用classList是一個方便的替代方法,可以將元素的類列表作為空格分隔的字...

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