Created
February 28, 2015 04:32
-
-
Save idmontie/570adef25e2439685f46 to your computer and use it in GitHub Desktop.
php-namespace-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My_Namespace; | |
class My_Class { | |
public static function my_method () { | |
return 'wow'; | |
} | |
} | |
?> | |
<?php | |
// In a seperate file | |
include 'my-class.php'; | |
echo \My_Namespace\My_Class::my_method(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment