View fiddle_493421.php
class ColorPalette{
public $color;
public function __construct($color){
$this->color = $color;
public function color_mod($hex, $diff) {
$rgb = str_split(trim($hex, '# '), 2);
View fiddle_058813.php
function getimg($sizeindex, $imgname ){
$imgsizes = array(
'x1267'=>'This is size 0 ' . $imgname ,
'x1268'=>'this is size 1 '. $imgname,
'x1269'=>'this is size two '. $imgname,
'x1210'=>'this is size three '. $imgname,
echo "My favorite number is " . $imgsizes[$sizeindex];
View fiddle_040668.php
//this is a single comment
#this is also a single line comment
/*this is a multiple
line comment
//PHP statement end with a semicolon
View fiddle_079137.php
echo 'Hello world';
View fiddle_096610.php
echo 'sample code';
View fiddle_019884.php
echo 'Hello World';
View fiddle_023131.php
//Autor: Walter Sanchez
//Fecha: 02 abril 2018
class html{
private $script=null;
public function cabeza($tituloPagina="Sin Titulo"){
$inicio = '<!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <title>'.$tituloPagina.'</title>';
$cierreHead = '</head>';
// compruebo que la propiedad script no sea nula es decir que se haya seteado.
View fiddle_033139.php
// Simple Encryption #1 - Alternating Split
For building the encrypted string:
Take every 2nd char from the string, then the other chars, that are not every 2nd char, and concat them as new String.
Do this n times!
function encrypt($text, $n) {
View fiddle_029304.php
$str = "abcde";
$nb = count($a);
if(strlen($a[$nb-1])<2) $a[$nb-1].="_";
View fiddle_080222.php
// $_SESSION['testcomplete'] = 'yes';