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
<html> | |
<body> | |
<h1>Hello world</h1> | |
One plus ten is equal to <?php echo 1+10; ?> | |
</body> | |
</html> |
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 | |
$number = 1; | |
$another_number = 4; |
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 | |
$apples = 10; | |
$oranges = 20; | |
$bananas = 5; | |
$totalFruits = $apples + $oranges + $bananas; | |
?> | |
There are <?php echo $totalFruits ?> fruits in total |
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 | |
$variable = 'number'; | |
$number = 10; | |
echo $$variable; // this will output "10" because you are referring to the variable called "number" |
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
<html ng-app="app"> | |
<body> | |
<div id="appBody" ng-controller="myController"> | |
</div> | |
<script type="text/javascript"> | |
var app = angular.module('app',[]); | |
function myController($scope){ | |
$scope.doSomething = function(){ | |
// do something here |
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 | |
// Safe Search and Replace on Database with Serialized Data v1.0.1 | |
// This script is to solve the problem of doing database search and replace | |
// when developers have only gone and used the non-relational concept of | |
// serializing PHP arrays into single database columns. It will search for all | |
// matching data on the database and change it, even if it's within a serialized | |
// PHP array. |
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 | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
class Cleaner{ | |
public function Cleaner($path){ | |
$di = new RecursiveDirectoryIterator($path); | |
foreach (new RecursiveIteratorIterator($di) as $filename => $file) { | |
if($file->isFile() && $file->getExtension()=='php'){ | |
$this->clean($filename); |
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
function getAuthString(){ | |
return base64_encode($username.':'.$password); | |
} | |
function sendRequest($params){ | |
$headers = array( | |
'Authorization: Basic '.getAuthString(), | |
'Content-Type: application/json', | |
); | |
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
// #1 - iterate only if no delete | |
for(var i=0 ;i<items.length;){ | |
if(items[i].forDelete){ | |
items.splice(i,1); | |
}else{ | |
i++; | |
} | |
} | |
// #2 - iterate backwards |
OlderNewer