"/^".$rutaBase."/" I want to compare if 2 absolute routes starts with the same "string". And PHP shows me this error message:
as Thomas said, your &rutaBase probably is outputting a dirt that should ge cleaned, show this var declaration
You can use substr and strlen. $rutaBase = "C:/xampp"; if (substr($_GET["dir"], 0, strlen($rutaBase)) === $rutaBase){ echo "ok"; }
Обсуждают сегодня