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 | |
/** | |
* Application class | |
* | |
* @author Shameer | |
*/ | |
class Application { | |
private $plugins = array(); | |
public function __construct() { | |
// Constructor |
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 | |
echo "<pre>"; | |
print_r(array_reverse(debug_backtrace(true))); | |
echo "</pre>"; | |
?> |
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 | |
$data = array ('name' => 'hello', 'email' => 'hello@hello.com'); | |
$data = http_build_query($data); | |
$context_options = array ( | |
'http' => array ( | |
'method' => 'POST', | |
'header'=> "Content-type: application/x-www-form-urlencoded\r\n" | |
. "Content-Length: " . strlen($data) . "\r\n", | |
'content' => $data | |
) |
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 | |
$time = array('morning', 'noon'); | |
array_filter($time, function($a){ | |
if($a=='noon') | |
echo 'Its lunch time'; | |
else | |
echo "Its time for breakfast"; | |
} | |
); | |
?> |
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 | |
$array = array(1,2,3,4,5); | |
$v= 4; | |
$result = array_filter($array,function($n) use(&$v){return $v === $n;}); | |
print_r($reslt); | |
?> |
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 | |
/** | |
* @param mixed $query Query to be prepared for executing | |
* multiple times | |
* Usage "SELECT * FROM table_name WHERE column = ? " | |
* "INSERT INTO table_name(field1,field2) VALUES(?,?) "; | |
* returns true if the query is a valid mysql statement else throws an | |
* exception | |
* | |
*/ |
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> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
(function($){ | |
$.fn.qr = function(){ | |
var url = $(this).attr('href'); | |
var size= 4; | |
return 'http://qrcode.kaywa.com/img.php?s='+size+'&d='+url; | |
}; |
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
tinyMCE.activeEditor.getContent() |
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 Controller_Foo extends | |
{ | |
public function action_foo() | |
{ | |
$ext_response = Request::factory('http://site.com/foo/bar/bas') | |
->execute() | |
->response; | |
} |
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 defined('SYSPATH') or die('No direct script access.'); | |
class Controller_Sample extends Controller | |
{ | |
public function action_index() | |
{ | |
$testConfig = Kohana::config('test'); | |
} | |
} |