Loading...

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

Temperature: 0 °C

Mark ChangMark Chang
author_tools


判斷字串是否存在於內容中
以下範例~

搜尋 If you are lucky enough to be different. 裡是否有 different 字串

$content = 'If you are lucky enough to be different.';
$string_a = 'different';//尋找內容裡是否有此字串
if (false !== ($rst = strpos($content , $string_a ))) {
echo 'yes';// 若存在
} else {
echo 'no'; // 若不存在
}


說真的,用的到。

https://innstory.com/story-判斷字串是否存在於內容中-1800
PHP

Prev
 刪除已上傳至server的檔案

Next
如何將mysql_table_autoincrement重設 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

fancybox close的方式

fancybox close...

parent.$.fancybox.close(); parent.jQuery.fancybox....

當域名 DNS 尚未生效時,如何預先設定及測試網站

當域名 DNS 尚未生效時,...

建置一個新的網站或是將網站搬家時 常常會遇到一個問題,就是要將網址指向到新的網站空間,設定完畢但需要...

RPO(Relative Path Overwrite)相對路徑覆蓋攻擊

RPO(Relative P...

首先,先來用例子說明何謂「相對路徑」何謂「絕對路徑」。 例如你有一個網址為http://www.de...

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