View fiddle_058280.php
<?php
class myClass{
public $id;
public function __construct($id){
$this->id = $id;
}
public function __toString(){
return "id is:".$this->id;
}
View fiddle_027521.php
<?php
echo 123;
?>
View fiddle_098607.php
<?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', 'com.pk', 'co.uk');
View fiddle_074847.php
<h2>Memorial Day Sale</h2>
<ul><li>Compaq Presario m2007us Notebook:
<strong>$799.99</strong></li>
<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
Monitor,
Silver/Black: <strong>$199.99</strong></li>
<li>Hawking Technology Hi-Speed Wireless-G Cardbus
Card:
View fiddle_066372.php
<?php
$colorValue = "Red, Black, Brown";
$colors = explode(',', $colorValue);
$colorcods = array(
"800000" => "Maroon",
"8B0000" => "DarkRed",
"B22222" => "FireBrick",
"FF0000" => "Red",
"FA8072" => "Salmon",
View fiddle_066520.php
<?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
_END;
fwrite($fh, $text) or die("Could not write to file");
View fiddle_018782.php
<!doctype html>
<html lang="en">
<head>
<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">
<title>Title</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
</head>
View fiddle_013888.php
<?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
<style>
.personal_details{
border: solid 1px darkblue;
width:350px;
height:300px;
font-family:arial;
background-color:grey;
}
</style>