Here is my PHP code,
$string = 'https://www.mydomain.lk/';
$wordlist = array("http://", "www.", "https://", "/");
foreach ($wordlist as &$word) {
$word = '/\b' . preg_quote($word, '/') . '\b/';
}
echo $string2 = preg_replace($wordlist, '', $string);
I want to remove last "/" from $string. so i add the "/" to $wordlist array, but its not working.
can somebody help me to fix this. Thanks.
mydomain.lkfromhttps://www.mydomain.lk/?