split string after x characters
// split a string from a number
public function split_on($string, $num) {
$length = strlen($string);
$output[0] = substr($string, 0, $num);
$output[1] = substr($string, $num, $length );
return $output;
}
// split a string from a number
public function split_on($string, $num) {
$length = strlen($string);
$output[0] = substr($string, 0, $num);
$output[1] = substr($string, $num, $length );
return $output;
}
google yahoo Click on google and yahoo to download code and try login without any key
insert into leaderboard(`user_name`,`score`) values(‘uspmca’,200) on DUPLICATE KEY update `score` = `score`+10 user_name needs to unique.
<?php $vidID=”qCwAitjixMo”; //http://www.youtube.com/watch?v=voNEBqRZmBc $url = “http://gdata.youtube.com/feeds/api/videos/”. $vidID; $doc = new DOMDocument; $doc->load($url); $title = $doc->getElementsByTagName(“title”)->item(0)->nodeValue; $duration = $doc->getElementsByTagName(‘duration’)->item(0)->getAttribute(‘seconds’); print “TITLE: “.$title.”<br />”; print “Duration: “.$duration .”<br />”; ?>
while(result=mysql_fetch_object(query)){ start div1 start innerdiv1 end innerdiv1 if(result=mysql_fetch_object(query)){ start innerdiv2 end innerdiv2 } if(result=mysql_fetch_object(query)){ start innerdiv3 end innerdiv3 } if(result=mysql_fetch_object(query)){ start innerdiv4 end innerdiv4 } ……………………………… end dive1 } it is in case of when you have a row to repeat but row have some columns also
global $wp_query; $wp_query = new WP_Query(array( ‘orderby’ => ‘post_title’,’order’ => ‘asc’,’listings_categories’ => ‘vegetarian’));
if($(“#”+ name).length ==0){ //it doesn’t exist }