开发者

Find to extract portion of a string in PHP [duplicate]

开发者 https://www.devze.com 2023-04-13 09:07 出处:网络
This que开发者_如何学编程stion already has answers here: Closed 11 years ago. Possible Duplicate:
This que开发者_如何学编程stion already has answers here: Closed 11 years ago.

Possible Duplicate:

how do i parse url php

I have strings in the format of 'http://www.example.com/', some of them have the trailing slash, and other don't, how would I extract 'example.com' from them?


Use parse_url. You want the host component. Once you have that, you can remove the www. if it exists.

0

精彩评论

暂无评论...
验证码 换一张
取 消