【发布时间】:2012-10-22 10:24:37
【问题描述】:
可能重复:
PHP startsWith() and endsWith() functions
Check if variable starts with ‘http’
如果 $mystring 有前缀“http://”然后{做某事},如何做一个 if 语句。
我在 Objective-c 中是这样完成的:
if([mynsstring hasPrefix:@"http://"])
{
//Do something...
}
我不知道如何在 PHP 中做到这一点。 提前感谢您的帮助。
【问题讨论】:
-
php.net/strings - 在 PHP 中,字符串库是一个函数列表,可能与目标 C 中的字符串对象不同。
标签: php objective-c string if-statement prefix