123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Technology,-Gadget-and-Science >> View Article

Some Php Functions You Must Know

Profile Picture
By Author: Zareef Ahmed
Total Articles: 2
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

PHP is a widely-used general-purpose scripting language that is
especially suited for Web development and can be embedded into HTML.
PHP has more than several thousands functions for many purpose.

For writing a program in any language we need basic language construct,
syntax and a large number of functions to get the desired result from
program.

In this article I will write about the some functions of PHP which are
very useful in creating a bug free, clean and efficient program.

We used print and echo functions to send the output to browser. so they
are of course one of the necessary functions of PHP. Without using them
you can not write a PHP program or at least can not show your work to
the world.

You must know the functions describe in this article, in order to write
a good and bug free code.

These are :-


error_reporting

The error_reporting() function sets the error_reporting directive at
runtime. PHP has many levels of errors, using this function sets that
level for the duration (runtime) ...
... of your script.


isset

This function determine whether a variable is set or not. It is very
useful in avoiding Notices generated by setting your error_reporting to
E_ALL. Undefined or un-initialised variables may be the main reasons
for many irritating bugs in your program, but remember isset() only
works with variables as passing anything else will result in a parse
error. For checking if constants are set use the defined() function.

print_r

This function prints human-readable information about a variable
It displays information about a variable in a way that's readable by
humans. If given a string, integer or float, the value itself will be
printed. If given an array, values will be presented in a format that
shows keys and elements. Similar notation is used for objects.

var_dump

This function displays structured information about one or more
expressions that includes its type and value. Arrays and objects are
explored recursively with values indented to show structure. In some
ways print_r and var_dump are similar.

ini_set and ini_get

These functions sets and gets the value of the given configuration
option. Returns the old value on success, FALSE on failure. The
configuration option will keep this new value during the script's
execution, and will be restored at the script's ending.
Not all the available options can be changed using ini_set(), You can
consult the PHP manual for a full list of available variables.

set_time_limit

This function set the number of seconds a script is allowed to run. If
this is reached, the script returns a fatal error. The default limit is
30 seconds or, if it exists, the max_execution_time value defined in the
php.ini. If seconds is set to zero, no time limit is imposed. It is very
usefull if you are working with a script which may take some time to
finish like sending a large number of emails.

When called, set_time_limit() restarts the timeout counter from zero. In
other words, if the timeout is the default 30 seconds, and 25 seconds
into script execution a call such as set_time_limit(20) is made, the
script will run for a total of 45 seconds before timing out.

set_time_limit() has no effect when PHP is running in safe mode. There
is no workaround other than turning off safe mode or changing the time
limit in the php.ini.

As I have told you , using these functions you can write a good and
bug free code so keep using them

About the Author Zareef Ahmed is php developer based in india, Delhi. He is doing web development since last five-six years.
He can be contacted at zareef@zareef.net. To know more about him you can visit his home page at http://www.zareef.net

Total Views: 96Word Count: 572See All articles From Author

Add Comment

Technology, Gadget and Science Articles

1. Syneron Laser Repair Services: Restore Performance, Protect Your Investment
Author: Ryan

2. Sitecore Vs Optimizely: A Guide To Selecting The Right Dxp
Author: Addact Technologies

3. Hourly Price Insights: Amazon, Myntra, Meesho & Flipkart – 2025
Author: Den Rediant

4. Erp For Small Business: Fuel Growth With Smarter Systems
Author: Alex Forsyth

5. How To Implement Secure Authentication In Mern Stack Projects?
Author: Mukesh Ram

6. Uber Eats Menu Price Tracking For Ecosystem Analysis
Author: Retail Scrape

7. Ai Tracks Noon Vs Amazon.ae Price Gaps In Uae Retail Market
Author: Actowiz Solutions

8. Reimagine Brand Management With Wave: The Future-ready Platform
Author: 5Flow

9. Hire Virtual Receptionists And Let Them Do The Work For You
Author: Eliza Garran

10. Understanding Why A Virtual Answering Service Is Needful
Author: Eliza Garran

11. What Makes Helical Insight Unique Among Open-source Business Analytics Tools?
Author: Vhelical

12. The Event Management Website That India’s Top Event Companies Rely On
Author: Enseur Tech

13. Top 5 Reasons To Partner With App Developers Near Me
Author: brainbell10

14. How A Custom Mobile App Solves Real Business Problems?
Author: brainbell10

15. How App Developers Near Me Stands Out From The Competition?
Author: brainbell10

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: