Keyur Keyur -4 years ago 222
PHP Question

remove http and https from string in php

I have several urls like,

I only want "" as string

And I want to remove the

https:// and http://

So I have taken array like this,

$removeChar = ["https://", "http://", "/"];

What is the proper way to remove these?

Answer Source

This worked for me,

$http_referer = str_replace($removeChar, "", "");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download