public static function setQuestionmarkOrAmp($url) { $isThereQMR = false; $isThereQMR = preg_match("/\\?/i", $url); if ($isThereQMR) { return '&'; } else { return '?'; } }