information technology and education, information communication technology education, technology information educational services
Aug 15, 2009
Some PHP functions you must know
Some PHP functions you must know PHP is a scripting language widely used isespecially that 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 a language the basic language we need to construct, syntax and a large number of functions for the desired result fromprogram.In this article I will write about the some functions of PHP arevery useful in creating an error-free, clean and efficient use and environmentally program.We print output functions for the browser. theyear so of course one of the necessary functions of PHP. Without themyou can not write a PHP program or at least do not show their work to world.You need to know the functions described in this article to writea well and without error code. These are: - The error_reporting error_reporting () function sets the error_reporting directive atruntime. PHP has a lot of errors, the function sets thatlevel for the duration (runtime) of your script. issetThis function to determine if a variable is set or not. You veryuseful to avoid messages that are generated using error_reporting toE_ALL. Undefined or un-initialized variables can be the most irritating reasonsfor many errors in your program, but remember, isset () onlyworks with variables like everything else is in a parseerror. To see if the constants are defined, select the ()-function printer function.print_rThis reading information about a variableIt displays information about a variable in a way that the byhumans read. If a string, integer or float, the value itself is beprinted. If there is an array, the values are in a format thatshows buttons and items. Similar notation is objects.var_dumpThis function displays structured information about one or moreexpressions that the nature and value. Arrays and objects with the values retued areexplored recursively to show the structure. In someways var_dump and print_r similar. ini_get and ini_set These functions and receives the value of a given configuration option. Retus the old value on success, FALSE on failure. Theconfiguration option is the new value in script'sexecution, and will be back on the script ending.Not all available options can with ini_set (), canconsult See the PHP manual for a complete list of features available variables.set_time_limitThis Number of second degree run a script. Ifthis is achieved, the script is a fatal mistake. The standard limit is30 seconds or, if it exists, the max_execution_time value thephp.ini. When at zero seconds, without time limits prescribed. You veryusefull if you are working with a script to take some 'time tofinish such as sending a large number of emails.When called, set_time_limit () starts the timeout counters to zero. Inother words, if the timeout is the default setting of 30 seconds, and 25 secondsinto script execution a call such as set_time_limit (20) is made, thescript has a duration of 45 seconds before the data. set_time_limit () has no effect when PHP is running in safe mode. Thereis no solution other than disabling the mode or change the time limit in the php.ini. As I said earlier, these functions may be a good and error-free code, so keep Zareef About the Author Ahmed is a PHP developer based in India, Delhi. He does not web development since the last five to six years.He can zareef@zareef.net. To lea more about him, you can visit his homepage at
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment