I need to call a function from a separate class file, let says:
class Functions { public function seoUrl($string) { $string = strtolower($string); $string = preg_replace("~[^\p{L}\p{N}\n]+~u", "-", $string); $string = preg_replace("/[\s-]+/", " ", $string); $string = preg_replace("/[\s_]/", "-", $string); return $string; } } I want Functions::seoUrl() to be call in another class file:
class Product { public function goto_url($url) { return Functions::seoUrl($url); } } I get error:
Fatal error: Class 'Functions' not found in C:\xampp\htdocs...
requireto load your classFunctions?public static function seoUrl($string)and now I can use all method across separate classes.