Created
February 11, 2015 16:11
-
-
Save zhiephie/3bd3aa9d284851b5ee18 to your computer and use it in GitHub Desktop.
namespace
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
#contoh | |
index.php | |
Test | |
didalam folder test ada file : | |
- Nama.php | |
#script : | |
- file Nama.php | |
<?php | |
namespace Test; //namespace kita deklarasikan | |
class Nama { | |
function kamu() | |
{ | |
echo 'nama saya kamu'; | |
} | |
} | |
#lalu save | |
index.php | |
<?php | |
include_once 'Test/Nama.php'; | |
$car = new \Nama; | |
$car->kamu(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment