<?php
/*
Online PHP Examples with Source Code
website: http://4evertutorials.blogspot.in/
*/
// Turn off all error reporting
error_reporting(0);
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
?>
Every once in a while I need to process a HUGE file. Though PHP probably isn't the most efficient way of processing the file, I'll usually use PHP because it makes coding the processing script much faster. To prevent the script from timing out, I need to increase the execution time of the specific processing script. Here's how I do it.
Creating radio elements in some content management systems can result into writing a lot of code. Just in case your radio group with multiple options is getting a value from a database and/or a form. There need to be a check for every posted value for every option. This function will do all this work for you, just create two arrays, one for the values and labels and for the related html code. It's up to the user if he uses 2 or more elements in one group. The function works with $_POST and $_GET data.
<?php
/*
Online PHP Examples with Source Code
website: http://4evertutorials.blogspot.in/
*/
$values = array('google'=>'Google Search', 'link'=>'Link on some website', 'advert'=>'Advertisement', 'news'=>'News');
$html_elements = array('before'=>'', 'after'=>'
', 'label'=>'
');
function radioGroup($formelement, $values, $html, $def_value = '') {
$radio_group = '
'."\n";
return $radio_group;
}
// place this code between the form tags:
// notice 'advert' could be a database value too
echo radioGroup('test', $values, $html_elements, 'advert');
?>