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 mb_substr() 函式,擷取部分字串並記得使用UTF-8。

使用PHP mb_subst...

pexelsphotohello5 文字長度太長,一般來說我們可以使用DIV包住字串,再定義DIV的...

在PHP裡添加HTTP Strict Transport Security

在PHP裡添加HTTP St...

要通過 PHP 啟用 HTTP 嚴格傳輸安全,請使用以下設定。 <?php //告訴瀏覽器站點只能通...

javascript如何取得檔案的副檔名?

javascript如何取得...

var filenamea = "aaa"; alert(getFileExte...

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