WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : quick sort for associative arrays
Categories : Algorithms, Arrays, PHP Update Picture
David Sklar
Date : Jan 16th 1999
Grade : 2 of 5 (graded 3 times)
Viewed : 12509
File : No file for this code example.
Images : No Images for this code example.
Search : More code by David Sklar
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?

function qsort($a,$f) {
qsort_do(&$a,0,Count($a)-1,$f);
}

function qsort_do($a,$l,$r,$f) {
if ($l < $r) {
qsort_partition(&$a,$l,$r,&$lp,&$rp,$f);
qsort_do(&$a,$l,$lp,$f);
qsort_do(&$a,$rp,$r,$f);
}
}

function qsort_partition($a,$l,$r,$lp,$rp,$f) {
$i = $l+1;
$j = $l+1;

while ($j <= $r) {
if ($f($a[$j],$a[$l])) {
$tmp = $a[$j];
$a[$j] = $a[$i];
$a[$i] = $tmp;
$i++;
}
$j++;
}

$x = $a[$l];
$a[$l] = $a[$i-1];
$a[$i-1] = $x;

$lp = $i - 2;
$rp = $i;
}

?>



A recursive function to traverse a multi-dimensional array where the dimensions are not known
Categories : Arrays, PHP, Algorithms
A simple bubblesort that takes 2 arrays as argument.The first one is the actual data used for sorting, the second is data that will "tag along" with the first array, for instance a descriptive text about the data in the first array.
Categories : Algorithms, Arrays, PHP, Complete Programs
New functions for PHP3. For those that know Perl, you will recognize a lot of these.All but one deal with array handling. Sorting, splicing, etc.
Categories : Algorithms, Arrays, PHP
A class to put get and post variables in hidden form elements. Works on scalars, normal arrays, associative arrays.
Categories : Algorithms, Variables, Arrays, PHP, PHP Classes
minus - subtract arrays. Send two arrays and get an array with the operation A-B, elements on A that are not included on B.
Categories : PHP, Arrays, Algorithms
grab the result of any calculation you submit to the Google Calculator.
Categories : PHP, Arrays, Web Services, Regexps, Math.
Finds the median in an array of numbers - Can be used with a MySql database column read into an array
Categories : PHP, Arrays, Databases, MySQL
dynamic table columns
Categories : PHP, HTML and PHP, Arrays, Databases, MySQL
BBCode Formatting String
Categories : PHP, HTML, Regexps, Arrays
Function to convert Arabic numbers into Roman Numerals
Categories : Algorithms, PHP, Date Time
create a grid out of <INPUT TYPE=TEXT> then saving to a database. Uses a 'multi-dimension array', but not really as the array is just one big array with the index of "[$i][$j]". Have a look at the code and you'll see what I mean.
Categories : PHP, MySQL, Arrays, Databases
CSS style switcher
Categories : PHP, CSS, HTML and PHP, Arrays, Sessions
Link Submition - Allow your visitors to submit links to the site.
Categories : PHP, Arrays, Filesystem, Beginner Guides
A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
This gets the http response headers for a given url and returns them in an assoc array. i.e. to test if a url exists: $array = get_http_headers($url); if($array[result]=200) { }
Categories : HTTP, Arrays, PHP