O'Reilly logo

Core PHP Programming: Using PHP to Build Dynamic Web Sites by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. SORTING, SEARCHING, AND RANDOM NUMBERS

Topics in This Chapter

  • Sorting

  • Bubble Sort

  • Quicksort

  • Built-In Sorting Functions

  • Sorting with a Comparison Function

  • Searching

  • Indexing

  • Random Numbers

  • Random Identifiers

  • Choosing Banner Ads

Sorting and searching are two fundamental concepts of computer science. They are closely tied to almost every application: databases, compilers, even the World Wide Web. The more information you have online, the more important it becomes to know exactly where that information is.

Admittedly, sorting is not as serious a topic in the context of PHP as it is for C++. PHP offers some very powerful sorting functions, even one that allows you to define how to compare two elements. Since this chapter deals with some classic ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required