2

Created by potrace 1.16, written by Peter Selinger 2001-2019

Creating URL from Title error in Php Local Environment

Hi, I am having trouble while creating URL's from the title, below is the code which is working in online editor but not working in my local dev environment.


Jetpack Security

Sucuri Security


public static function uri($url) {
    # Prep string with some basic normalization
    $url = strtolower($url);
    $url = strip_tags($url);
    $url = stripslashes($url);
    $url = html_entity_decode($url);
    # Remove quotes (can't, etc.)
    $url = str_replace('\'', '', $url);
    # Replace non-alpha numeric with hyphens
    $match = '/[^a-z0-9]+/';
    $replace = '-';
    $url = preg_replace($match, $replace, $url);
    $url = trim($url, '-');
    return $url;
 }


Please advice how to fix it!

0

Created by potrace 1.16, written by Peter Selinger 2001-2019

Imtiyaz Mohammed

25 September, 2024

# php comment

0

Created by potrace 1.16, written by Peter Selinger 2001-2019

Akram Quraishi

28 September, 2024

Adding line numbers will be great.

Mohammed Khaled Khan

08 October, 2024

Akram Quraishi done! please check the above code!



Mohammed Imtiyaz

09 October, 2024

If I mention Mohammed Imtiyaz will this tag me?