View fiddle_058280.php
class myClass{
public $id;
public function __construct($id){
$this->id = $id;
public function __toString(){
return "id is:".$this->id;
View fiddle_027521.php
echo 123;
View fiddle_098607.php
function getTopLevelDomain($url){
$urlData = parse_url($url);
$urlHost = isset($urlData['host']) ? $urlData['host'] : '';
$isIP = (bool)ip2long($urlHost);
if($isIP){ /** To check if it's ip then return same ip */
return $urlHost;
$urlMap = array('com', '', '');
View fiddle_074847.php
<h2>Memorial Day Sale</h2>
<ul><li>Compaq Presario m2007us Notebook:
<li>Epson Stylus CX6600 Color All-In-One Printer,
Print/Copy/Scan: <strong>$699.99</strong></li>
<li>Proview Technology Inc. KDS K715s 17-inch LCD
Silver/Black: <strong>$199.99</strong></li>
<li>Hawking Technology Hi-Speed Wireless-G Cardbus
View fiddle_066372.php
$colorValue = "Red, Black, Brown";
$colors = explode(',', $colorValue);
$colorcods = array(
"800000" => "Maroon",
"8B0000" => "DarkRed",
"B22222" => "FireBrick",
"FF0000" => "Red",
"FA8072" => "Salmon",
View fiddle_066520.php
function diddyMyRobot($x, $y, $d, $sp) {
$stringArray = str_split($sp);
foreach( $stringArray as $key => $value ){
if( $value == 'W' ) { continue; }
switch ( strtoupper($d) ) {
View fiddle_094485.php
<?php // testfile.php
$fh = fopen("testfile.txt", 'w') or die("Failed to create a file");
$text = <<<_END
Line 1
Line 2
Line 3
fwrite($fh, $text) or die("Could not write to file");
View fiddle_018782.php
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="">
View fiddle_013888.php
//setting namespace
$ns = "http://".$_SERVER['HTTP_HOST']."/12141363/wskategori.php";
//load nusoap library
require_once 'lib/nusoap.php';
$server = new soap_server;
//create soap server object
$server->configureWSDL("WEB SERVICE MENGGUNAKAN SOAP WSDL", $ns); // wsdl configuration
View fiddle_083124.php
border: solid 1px darkblue;