标签: php substr
我正在尝试用php编写这个:
if ($image starts with "photos/") { echo "the image path starts with photos/"; }
答案 0 :(得分:12)
if (substr($image, 0, 7) == 'photos/')