Pramod T P

Search
Skip to content
  • Home
  • PHP
  • WordPress
  • Linux
  • Magento
  • My SQL
  • Profile
  • comments

Daily Archives: May 23, 2012

PHP

usleep()

May 23, 2012 Pramod T P

It delays execution in microseconds

Example

<?php
echo date(‘h:i:s’) . “<br />”;
usleep(20000000);
echo date(‘h:i:s’);
?>

Output

06:02:42
06:03:02

FunctionsmiscMiscellaneousPHP
PHP

unpack()

May 23, 2012 Pramod T P

It unpacks data from binary string

Example

<?php
echo “<pre>”;
print_r(unpack(“C*”,”phpcode”));
?>

Output

Array
(
[1] => 112
[2] => 104
[3] => 112
[4] => 99
[5] => 111
[6] => 100
[7] => 101
)

FunctionsmiscMiscellaneousPHP
PHP

uniqid()

May 23, 2012 Pramod T P

It generates a unique ID

Example

<?php
echo uniqid();
?>

Output

4fbcd679849c3

FunctionsmiscMiscellaneousPHP
PHP

time_sleep_until()

May 23, 2012 Pramod T P

It makes the script sleep until the specified time

Example

<?php
time_sleep_until(time()+5);
?>

FunctionsmiscMiscellaneousPHP
PHP

time_nanosleep()

May 23, 2012 Pramod T P

It delay for a number of seconds and nanoseconds

Example

<?php
echo time_nanosleep(0, 500000000)?”Slefpt for half second”:”No”;
?>

Output

Slefpt for half second

FunctionsmiscMiscellaneousPHP
PHP

sys_getloadavg()

May 23, 2012 Pramod T P

It returns system load average

Example

<?php
echo “<pre>”;
print_r(sys_getloadavg());
?>

Output

Array
(
[0] => 0.1
[1] => 0.27
[2] => 0.37
)

FunctionsmiscMiscellaneousPHP
PHP

sleep()

May 23, 2012 Pramod T P

It delays execution

Example

<?php
echo date(‘h:i:s’) . “<br />”;
sleep(10);
echo date(‘h:i:s’) . “<br />”;
?>

Output

05:38:00
05:38:10

FunctionsmiscMiscellaneousPHP
PHP

show_source()

May 23, 2012 Pramod T P

Its an alias of highlight_file() and outputs a file with the PHP syntax highlighted

Example

<?php
echo show_source(“index.php”);
?>

FunctionsmiscMiscellaneousPHP
PHP

php_strip_whitespace()

May 23, 2012 Pramod T P

It returns the source code of a file with PHP comments and whitespace removed

Example

<?php
echo php_strip_whitespace(“index.php”);
?>

please check the view source and it should be

<?php
echo php_strip_whitespace(“index.php”); ?>

FunctionsmiscMiscellaneousPHP
PHP

php_check_syntax()

May 23, 2012 Pramod T P

It heck the PHP syntax of  the specified file

Example

<?php
php_check_syntax(“index.php”);
?>

its deprecated in PHP 5.0.5

FunctionsmiscMiscellaneousPHP

Posts navigation

1 2 … 7 Next →

Zend | Magento Certified PHP | eCommerce Architect

For Latest Updates
Visit phpcodez.com

Categories

Recent Posts

  • Regular expression
  • preg_match
  • Redirect root domain to a subdomain .htaccess
  • Redirect root domain to a subfolder .htaccess
  • Force SSL htaccess
May 2012
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Apr   Jun »

Recent Comments

togel online's avatartogel online on How to terminate the current s…
business funding's avatarbusiness funding on compare two strings – ja…
unsecured loans uk's avatarunsecured loans uk on Function to add an element int…
treating back pain's avatartreating back pain on Submit HTML form to pop up pag…
Pura Cleanse's avatarPura Cleanse on Add the block "Based on y…
  • RSS - Posts
Blog at WordPress.com.
Pramod T P
Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Pramod T P
    • Already have a WordPress.com account? Log in now.
    • Pramod T P
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...