Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ngopi{
- public $kopi;
- public $udud;
- public $nikmat=true;
- public function __construct($kopi,$udud){
- $this->kopi=$kopi;
- $this->roko=$udud;
- }
- public function samsu_dua_mantap(){
- return "Kopi = $this->kopi\n"."Roko = $this->roko";
- }
- }
- $bongkar=new ngopi("Kopi Bongkar","Samsul dua batang mantap");
- $nyoh = new ngopi("Kopi Tubruk","Djarum Coklat");
- $nyoh->nikmat=false;
- echo $bongkar->samsu_dua_mantap();
- class Handphone{
- public $kamera;
- public $tahun;
- public $layar_sentuh=true;
- public function __construct($kamera,$tahun){
- $this->kamera=$kamera;
- $this->tahun=$tahun;
- }
- public function ambil_photo(){
- return "$this->kamera \njepret..!!";
- }
- }
- $canggih = new Handphone("Kamera: 8 Megapixels","Tahun : 2013");
- $jadul = new Handphone("Kamera: 2 Megapixels","Tahun : 2012");
- $jadul->layar_sentuh=false;
- echo $canggih->ambil_photo();
- <?
- class Kucing {
- public $lucu = true;
- public $warna;
- public function __construct($warna) {
- $this->warna= $warna;
- }
- public function meong(){
- return "Meoing..!!";
- }
- public function menyapa(){
- return "Hai, saya si $this->warna";
- }
- }
- $putih=new kucing("putih");
- $hitam=new kucing("hitam");
- echo $putih->menyapa()."\n".$hitam->menyapa()."\n";
- echo $hitam->meong();
- ?>
- <?
- class Orang {
- public $lokasi = "codesaya";
- public $nama;
- public $umur;
- public function __construct($nama, $umur) {
- $this->nama = $nama;
- $this->umur = $umur;
- }
- // ciptakan metode menyapa() di bawah
- public function menyapa(){
- return "Hi, saya $this->nama umur saya $this->umur.";
- }
- }
- $saya = new Orang("Rasmus Lerdorf", 44);
- // panggil dan cetak metode menyapa() $saya di bawah
- echo $saya->menyapa();
- ?>
- class Orang {
- public $lokasi = "codesaya";
- public $nama;
- public $umur;
- // berikan __construct di bawah
- public function __construct($nama,$umur){
- $this->nama=$nama;
- $this->umur=$umur;
- }
- }
- // Ubah baris dibawah dengan memberi
- // dua parameter di antara tanda kurung
- $guru = new Orang("Soleh ",30);
- $murid = new Orang("Puji ",29);
- // akses properti dari $guru & murid di bawah
- echo $guru->nama.$guru->umur."\n";
- echo $murid->nama.$murid->umur;
- <!doctype html>
- <html>
- <head>
- <title>wewwww</title>
- <link rel="shortcut icon" href="logo3.png">
- </head>
- <body>
- <div id="topologi">
- <?php
- class topology{
- public $network;
- public $ip_address;
- public $proxy=true;
- public function __construct($network,$ip_address){
- $this->network = $network;
- $this->ip_address = $ip_address;
- }
- public function tproxy(){
- return "Network = ".$this->network."<br/>"."ip_address = ".$this->ip_address;
- }
- }
- $tunel = new topology("Yes Via Proxy","10.0.40.254");
- $transparent = new topology("No Proxy detect","118.220.222.234");
- $client_side = $tunel->tproxy();
- $tunel->proxy = false;
- echo $client_side."<br/><br/>";
- for($abc=1;$abc<50;$abc++){
- echo "*";
- }
- echo "<br/><br/>";
- if($client_side == $tunel->tproxy()){
- echo 'Tproxy Topology'."<br/>".
- '<img src=" http://1.bp.blogspot.com/-Nk6LcVPp1qg/VYe1No9OlTI/AAAAAAAAAho/45EtnMJaLiY/s1600/Topologi%2Bjaringan.jpg" width="500" height="350"/>';
- }
- elseif($client_side !== $tunel->tproxy()){
- echo "No Proxy Detect";
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement