0

I created this function:

index.php:

<?php
 function hello(){
    echo "hello word";
}
?>

which works, but refreshing the page in tideSDK gives this error:

Fatal error: Cannot redeclare hello() (previously in .......)

How do I fix this?

Luke Peterson
  • 8,584
  • 8
  • 45
  • 46
Sam
  • 1
  • I fixed this problem, using: if(!function_exists('hello')){ function hello(){ ....... } } //function_exists return true if the function exists else return false . – Sam Jul 08 '14 at 21:37

1 Answers1

0

the functions is save in the cache of the app,

if refresh the page, the app will the functions pre creates.

solution:

if(!function_exist("hello")){
 function hello(){
     echo "hello word";
 }
}
Sam
  • 1