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取得目前網址方式

使用PHP取得目前網址方式

pexelsphoto55 使用PHP取得網址相關的方式有下列幾種: $SERVER["R...

修改php.ini更改允許上傳檔案的大小

修改php.ini更改允許上...

使用vi或vim開啟php.ini #vim /etc/php/apache/php.ini 找到以...

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

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

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

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