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
http://www.linein.org/blog/ |
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
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> | |
<script src="jquery.innerfade.js" type="text/javascript"></script> | |
<script> | |
$(document).ready(function() { | |
$('#image_rotate').innerfade({ | |
speed: 'slow', | |
timeout: 2000, | |
type: 'sequence', | |
containerheight: '220px' | |
}); |
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 | |
/** | |
* This function can be used to check the sanity of variables | |
* | |
* @access private | |
* | |
* @param string $type The type of variable can be bool, float, numeric, string, array, or object | |
* @param string $string The variable name you would like to check | |
* @param string $length The maximum length of the variable | |
* |
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
Step: MySQL provides LIMIT clause so we just have to leverage it to rewrite the query as follows | |
SELECT * | |
FROM table_name | |
ORDER BY column_name DESC | |
LIMIT n - 1, 1 | |
Step :Query to get the nth highest record | |
SELECT * | |
FROM ( |
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
http://net.tutsplus.com/articles/news/htaccess-files-for-the-rest-of-us/ |
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
// set current date | |
$date = '04/30/2009'; | |
// parse about any English textual datetime description into a Unix timestamp | |
$ts = strtotime($date); | |
// find the year (ISO-8601 year number) and the current week | |
$year = date('o', $ts); | |
$week = date('W', $ts); | |
// print week for the current date | |
for($i = 1; $i <= 7; $i++) { | |
// timestamp from ISO week date format |
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
private function flatten($array, $base = "", $div_char = "/") | |
{ | |
$ret = array(); | |
if(is_array($array)) | |
{ | |
foreach($array as $k => $v) | |
{ | |
if(is_array($v)) | |
{ | |
$tmp_array = flatten($v, $base.$k.$div_char, $div_char); |
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 r_implode( $glue, $pieces ) | |
{ | |
foreach( $pieces as $r_pieces ) | |
{ | |
if( is_array( $r_pieces ) ) | |
{ | |
$retVal[] = r_implode( $glue, $r_pieces ); | |
} | |
else | |
{ |
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 objectToArray( $object ) | |
{ | |
if( !is_object( $object ) && !is_array( $object ) ) | |
{ | |
return $object; | |
} | |
if( is_object( $object ) ) | |
{ | |
$object = get_object_vars( $object ); | |
} |
NewerOlder