Here's a quick way to search for a word inside a string, using strpos the string to look at and the word to look for. Upon a match, true is returned.
$string = 'https://api.domain.com/files';
if (strpos($string, 'api') !== false) {
echo 'true';
}
Subscribe to my newsletter for the latest updates on my books and digital products.
Find posts, tutorials, and resources quickly.
Subscribe to my newsletter for the latest updates on my books and digital products.