Reputation: 482
I am new to php, just got stuck with something could be even simple... Anyway, I want to do some action if the value from the "url" has a word "Success" in it:
$c = file_get_content($url)
Upvotes: 1
Views: 144
Reputation: 1128
You may use stripos() for case-insensitive, and strpos() for case-sensitive search.
Upvotes: 0
Reputation: 298126
Always search through the PHP documentation:
if (strpos($c, "string") !== false) {
// "string" is in $c
} else {
// "string" isn't in $c
}
Upvotes: 3