Archive for the ‘Programming’ Category

Check Site Loading Speed using CURL curl_getinfo() in PHP.

Monday, June 22, 2009 10:06 3 Comments

We use curl_getinfo() in to get the information of last transfer that made use of curl functions in PHP.  Using the following code we can get the time taken to load a webpage. $ch = curl_init(‘http://www.inetminds.com/parsing-xml-feeds-in-php-with-simplexml-111/’); // set  cURL to return the contents in a variable instead of giving it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, [...]

This was posted under category: PHP, Programming Tags: , , , , , ,

How to find duplicate values in array

Tuesday, March 17, 2009 5:11 No Comments

simple way to find the duplicate values in array. function array_duplicates_values($array) { if(!is_array($array)) return false; $duplicates = array(); $unique = array_unique($array); if(count($array) > count($unique)) for($i = 0; $i < count($array); $i++) if(!array_key_exists($i, $unique)) $duplicates[] = $array[$i]; return $duplicates; } above function will return the duplicate values in array.

This was posted under category: PHP Tags:

Simple Image Swaping or Slide Show using Java Script

Tuesday, January 13, 2009 8:27 No Comments

Its very simple to create a slide show using JavaScript. < html > < head > < meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> < title> < /title> < script type="text/javascript"> function f1(){ if(document.getElementById(“d1″).style.display==’block’){ document.getElementById(“d1″).style.display=’none’; document.getElementById(“d2″).style.display=’block’; document.getElementById(“d3″).style.display=’none’; document.getElementById(“d4″).style.display=’none’; document.getElementById(“d5″).style.display=’none’; } else if(document.getElementById(“d2″).style.display==’block’){ document.getElementById(“d1″).style.display=’none’; document.getElementById(“d2″).style.display=’none’; document.getElementById(“d3″).style.display=’block’; document.getElementById(“d4″).style.display=’none’; document.getElementById(“d5″).style.display=’none’; } else if(document.getElementById(“d3″).style.display==’block’){ document.getElementById(“d1″).style.display=’none’; document.getElementById(“d2″).style.display=’none’; document.getElementById(“d3″).style.display=’none’; document.getElementById(“d4″).style.display=’block’; document.getElementById(“d5″).style.display=’none’; } else [...]

This was posted under category: Java Script, Programming Tags: , , ,

Parsing XML Feeds in PHP with simplexml

Tuesday, December 30, 2008 13:56 6 Comments

Parsing XML feeds is always something I’ve wanted to to do with PHP. But I’ve only bothered to learn how to do it. Now, there are different ways to do this, many of which uses different packages/plugins which need to be installed on the server. I am going to use simplexml, since it’s built into [...]

This was posted under category: PHP, Programming Tags: , , , ,

Some PHP Resource Websites

Tuesday, December 30, 2008 13:00 1 Comment

PHP is a very vast language. It’s hard master it.You may know how to crop an image using GD and process web requests with XML-RPC. You may know one of them, but not the both. There are many of resources there that help you learn the basics of PHP Processing forms, security, database interactions and [...]

This was posted under category: PHP Tags: , , ,