This file contains hidden or 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 | |
abstract class User { | |
protected $scores = 0; | |
protected $numberOfArticles = 0; | |
public function setNumberOfArticles($int) { | |
$numbeOfArticles = (int)$int; | |
$this->numberOfArticles = $numbeOfArticles; | |
} | |
public function getNumberOfArticles() { | |
return $this->numberOfArticles; |
This file contains hidden or 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 User { | |
protected $username; | |
public function setUsername($uname) { | |
$this->username = $uname; | |
} | |
public function getUsername() { | |
return $this->username; | |
} | |
} |
This file contains hidden or 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 | |
abstract class User { | |
protected $username; | |
public function setUsername($uname) { | |
$this->username = $uname; | |
} | |
public function getUsername() { | |
return $this->username; | |
} | |
abstract public function stateYourRole(); |
This file contains hidden or 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 | |
// simple inheritance and modifiers example. | |
class User { | |
private $username; | |
public function setUsername($uname) { | |
$this->username = $uname; | |
} | |
public function getUsername() { | |
return $this->username; | |
} |
This file contains hidden or 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
This gist was removed completely. |
This file contains hidden or 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
h1 { | |
text-align: center; | |
} |
This file contains hidden or 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 | |
/* | |
* ip_in_range.php - Function to determine if an IP is located in a | |
* specific range as specified via several alternative | |
* formats. | |
* | |
* Network ranges can be specified as: | |
* 1. Wildcard format: 1.2.3.* | |
* 2. CIDR format: 1.2.3/24 OR 1.2.3.4/255.255.255.0 | |
* 3. Start-End IP format: 1.2.3.0-1.2.3.255 |
This file contains hidden or 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 | |
/** | |
* Live Coding Section | |
* - You don't need to finish all of this. | |
* - Using the internet to look things up is encouraged. | |
*/ | |
echo 'Live Coding Section starts here! <br/><br/>'; | |
// Write three functions that compute the sum of the numbers in a given list using: a for-loop, a while-loop, and then recursion. |
This file contains hidden or 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 | |
$data[] = [ | |
'sponsor_id' => 2, | |
'enroller_id' => 4, | |
]; | |
//using [] after $data will concatenate otherwise override | |
$data[] = [ | |
'sponsor_id4' => 2, | |
'enroller_id5' => 4, |
This file contains hidden or 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
<pre> | |
<?php | |
$key = md5(utf8_encode("MobileAppSecureKey"), true); | |
$data = base64_decode("bkCfcseIt/TPsgNCdyX9fv2/4MjOJdaPXakNNbxQT3n6tXHa5bDoXojQ3g7jPLCu+wjwD0guQzw3hCFUSVx47PmDNHASk7g/kJ4K4tX0VGI="); | |
for($i = 0; $i < 8; $i++) { | |
$key[$i + 16] = $key[$i]; | |
} |