-2
可能重複:
PHP startsWith() and endsWith() functions
Check if variable starts with ‘http’字符串有前綴PHP
如何讓if語句,如果$ MyString中的前綴 「HTTP://」,那麼{做東西}。
我在Objective-C這樣做是這樣的:
if([mynsstring hasPrefix:@"http://"])
{
//Do something...
}
我不知道如何在PHP中做到這一點。 感謝您的幫助提前。
http://php.net/strings - 在PHP中,字符串庫是一個函數列表,可能與目標C中的字符串對象不同。 – hakre