I know is something pretty simple for someone who understand well preg_replace but I can't understand how to remove part of url. I have form where user should enter a
$result = preg_replace('https://example.com/page/', '', $str);
Warning: preg_replace(): Delimiter must not be alphanumeric or backslash
preg_replace() function should be like this:
$result = preg_replace('$(https|http)://example.com/page/$', '', $str);
You can use
$ as a delimiter.