致命错误:无法重新声明example()(之前已声明

I' am using XAMPP and I' am getting this error

Fatal error: Cannot redeclare example() (previously declared in

I understand about this error, It means that the function has been declared somewhere else.

In my www.example.com/cores/functions.php I' am declaring this function

function example(){
    $site_name = "Example CMS";
    return $site_name;
}

What this function will do, it will hold the default Example CMS. But if someone declares the same function in www.example.com/functions.php, then the system should pickup this which is in www.example.com/functions.php and should not pick in www.example.com/cores/functions.php

In my www.example.com/functions.php

function example(){
    $site_name = "My CMS";
    return $site_name;
}

Is that possible?

Yes, but only if you include the www.example.com/functions.php first. Then in your cores/functions.php do this:

if (!function_exists('example')) {
  function example(){
    $site_name = "Example CMS";
    return $site_name;
  }
}

If there is no (previously declared ... part of the error message, it means you try to create a function which is already a built-in function.