How to create an if statement to evaluate the first 7 characters in PHP?

I am trying to write this in php:

if ($image starts with "photos/") { echo "the image path starts with photos/"; } 
+4
source share
1 answer
 if (substr($image, 0, 7) == 'photos/') 
+12
source

Source: https://habr.com/ru/post/1384452/


All Articles