Detecting a url using preg_match? without http:// in the string

后端 未结 5 1051
执念已碎
执念已碎 2020-11-30 08:12

I was wondering how I could check a string broken into an array against a preg_match to see if it started with www. I already have one that check for http://www.

         


        
5条回答
  •  没有蜡笔的小新
    2020-11-30 08:44

    Try implode($myarray, '').strstr("www.")==0. That implodes your array into one string, then checks whether www. is at the beginning of the string (index 0).

提交回复
热议问题