Jump to content

[SOLVED] Removing a forward-slash from the tail-end of an URL


ArizonaJohn

Recommended Posts

Hello,

 

The code below removes "www.", etc. from the beginning of websites that are entered into a database.  It works great.

 

Is there a way I could use similar code to remove a forward-slash from the tail-end of a website that is entered into the same database? 

 

Thanks in advance,

 

John

 

$remove_array = array('http://www.', 'http://', 'https://', 'https://www.', 'www.');
$site = str_replace($remove_array, "", $_POST['site']);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.