ITTreats.com
Enter your Search term and Hit "Enter"

Sat, 20 Mar 2010 12:15:39 PM +00:00

Latest 'ITTreats'


Calculate Page Execution time in PHP

Calculate Page Execution time in PHP

For those people who want to give users that in how many seconds actually your web page loaded completely. This script will be useful for you. There are so many ways to do this ( As usual ) but the classic approach would be

Step 1 : make a note of  the time when your page get starts

Step 2: make a note of  the time  at the end of your total page execution

Step 3 : step 2 – step1, You will get your page execution time

In simple   Here is the function  which will do it for you .

You have  to   call the function at the  start  and   echo  it  at the  end.   simple !!!!

More . . .

Text Area Values into Array in PHP

Text Area Values into  Array in PHP

If you  want  to split up  the total text area content  into  array  based on the  row ,  Here is simple solution  to convert  textarea  field  value into  array in PHP.

$total=$_POST["textarea"]
 
$keyarr=explode("\n",$total);
// In order to  process this  array  values  here is the code 
 
foreach($keyarr  as  $key=>$value)
{
   //  becareful to check the value for  empty line 
   $value=trim($value);
   if  (!empty($value))
   {
        // Carry out your  own operations 
   }
}