ereg_replace
is now deprecated, so it is better to use:
$url = preg_replace("(^https?://)", "", $url );
This removes either http://
or https://
More Related Contents:
- calling function inside preg_replace thats inside a function
- Laravel function name must be a string [closed]
- PHP syntax for dereferencing function result
- Replace URLs in text with HTML links
- How can I handle the warning of file_get_contents() function in PHP?
- Replacing accented characters php
- What is the difference between a language construct and a “built-in” function in PHP?
- How would I skip optional arguments in a function call?
- PHP remove special character from string
- Use a variable to define a PHP function
- Shorten long numbers to K/M/B?
- Regular expressions for a range of unicode points PHP
- PHP function with variable as default value for a parameter
- Function list of php file
- How to remove diacritics from text?
- PHP using preg_replace : “Delimiter must not be alphanumeric or backslash” error
- Why are PHP function calls *so* expensive?
- Get variables from the outside, inside a function in PHP
- Jquery ajax setTimeout after form succes not redirecting?
- Undefined variable problem with PHP function
- Javascript and PHP functions
- Regex to strip comments and multi-line comments and empty lines
- Modify a globally scoped variable inside of an anonymous function
- Cannot redeclare function php [duplicate]
- PHP get all arguments as array?
- Use php namespace inside function
- regular expression and forward slash
- When to use a Class vs. Function in PHP
- Extract first integer in a string with PHP
- How can you use php in a javascript function [duplicate]