php check if string contains url
snippet in php

php check if string contains url

user4677

preg_match('/(http|ftp|mailto)/', $string, $matches);
var_dump($matches);

php if url contains

user9838

if(strpos($_SERVER['REQUEST_URI'], "string")) {
  ...
}