View fiddle_075706.php
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
<?php | |
class First{ | |
public function printP(){ | |
print('P is great!'); | |
} | |
} | |
class Second{ |
View 6552a3198e54a1dc3948b050722912a8.php
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
<?php | |
$class = "Level 1"; | |
$random = rand(0,3); | |
if($random==0) | |
{ | |
$class = "Level 2"; | |
} | |
elseif($random==1) | |
{ |
View fiddle_094226.php
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
<?php | |
$class = "Level 1"; | |
$random = rand(0,3); | |
if($random==0) | |
{ | |
$class = "Level 2"; | |
} | |
elseif($random==1) | |
{ |
View fiddle_059375.php
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
<?php | |
$age = 0; | |
$message0 = "At first, "; | |
$message1 = "you are age "; | |
$message2 = "After a while: "; | |
$message3 = "you die!"; | |
echo ($message0); | |
while($age<50){ |
View fiddle_071573.php
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
<?php | |
$rows = [ | |
'row1' => [ | |
'color' => 'red', | |
'width' => '550px', | |
'img' => 'http://www.google.com.au/images/srpr/logo11w.png' | |
], | |
'row2' => [ | |
'color' => 'black', |
View fiddle_046804.php
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
<?php | |
function getClass(){ | |
$class = "Level 1"; | |
$random = rand(0,3); | |
if($random==0) | |
{ | |
$class = "Level 2"; | |
} | |
elseif($random==1) |
View bd9ac5ec00167eb9270326e5655c7c3b.php
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
<?php | |
$level=1; | |
while($level<50){ | |
$random = rand(0,3); | |
if($random==0){ | |
echo ("Level 0 message!<br/>"); | |
$level += 10; | |
} | |
elseif($random==1){ | |
echo ("Level 1 message!<br/>"); |
View fiddle_014530.php
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
<?php | |
function goOn($number){ | |
for($i=0; $i < $number; $i++){ | |
$name = "Apprentice"; | |
$random = rand(0,3); | |
if($random==0) | |
{ | |
$name = "Intermediate Apprentice <br/>"; | |
} |
View 19c763e8e5d37d254c5f98549b3ddb64.php
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
<?php | |
/** | |
* | |
* cURL and XML parsing. | |
* | |
*/ | |
$url = "http://www.w3schools.com/xml/simple.xml"; | |
$ch = curl_init(); |
View fiddle_015091.php
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
<?php | |
// Function to test for time overlap | |
// $start_time A start date YYYY-MM-DD HH:MM:SS | |
// $end_time An end date YYYY-MM-DD HH:MM:SS | |
// $times An array of times to match against | |
// Returns true if there is an overlap false if no overlap is found | |
function time_overlap($start_time, $end_time, $times){ | |
$ustart = strtotime($start_time); | |
$uend = strtotime($end_time); |
OlderNewer