Keyur Keyur - 1 year ago 124
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