Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Keep The TechnoWorldInc.com Community Clean: Read Guidelines Here.
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Programming Zone » PHP
 Some PHP functions you must know
Pages: [1]   Go Down
  Print  
Author Topic: Some PHP functions you must know  (Read 1029 times)
Daniel Franklin
TWI Hero
**********


Karma: 3
Offline Offline

Posts: 16647


View Profile Email
Some PHP functions you must know
« Posted: September 26, 2007, 12:17:47 PM »


riting 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

Articles Source - Free Articles

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.102 seconds with 24 queries.