我有几个网址,例如
https://example.com/
http://example.com/
我只想要“example.com”作为字符串
我想删除
https:// and http://
所以我采取了这样的阵列,
$removeChar = ["https://", "http://", "/"];
删除这些的正确方法是什么?
最佳答案
这对我有用,
$http_referer = str_replace($removeChar, "", "https://example.com/");
关于php - 从php中的字符串中删除http和https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37415308/