Jeffery Vaska has “10 Tips That Every PHP Newbie Should Know“, a nice collection of tips for a newbie venturing into PHP. Tips like MySQL Connection Class, Dealing with Magic Quotes etc can be found there.
Jeffery Vaska has “10 Tips That Every PHP Newbie Should Know“, a nice collection of tips for a newbie venturing into PHP. Tips like MySQL Connection Class, Dealing with Magic Quotes etc can be found there.
The following code is basically JS, but has been made into a PHP function so that it could be invoked with different parameters as per our needs.
<?php
function js_redirect($url, $seconds=5) {
echo “<script language=\”JavaScript\”>\n”;
echo “<!– hide code from displaying on browsers with JS turned off\n\n”;
echo “function redirect() {\n”;
echo “window.location = \”" . $url . “\”;\n”;
echo “}\n\n”;
echo “timer [...]
Spellify automatically checks for spelling errors on user entered text in input text fields. Spellify is powered by the Google™ spell checker. You can see a demo at te homepage and also download the latest version there. Spellify not only works for text fields, but also on text areas.
Open Flash Chart lets you make great chart/pie representations from you data for a great looking output. The data file is either a text file, or a .php, Perl, Python, Java (or another flavour of dynamic) page.
Open Flash Chart, is open source. It is free to use and you get the source code to fiddle [...]
/*
PHP Performance Benchmark Script
Copyright 2003 : PHP Consulting
There are two settings:
First, set $file to be the server and page that you want to benchmark.
Secondly, set $iter to be the number of times you want it loaded.
*/
error_reporting(E_ALL ^ E_NOTICE); //For disabling non fatal error outputs
$file = “http://127.0.0.1/Joomla/index.php”; //Location to file
$iter = 5; //No of times to [...]
<?php
function filename_safe($filename) {
$temp = $filename;
// Lower case
$temp = strtolower($temp);
// Replace spaces with a ’_’
$temp = str_replace(” ”, ”_”, $temp);
// Loop through string
$result = ”;
for ($i=0; $i<strlen($temp); $i++) {
if (preg_match(’([0-9]|[a-z]|_)’, $temp[$i])) {
$result = $result . $temp[$i];
}
}
// Return filename
return $result;
}
?>