11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 7 • ADVANCED OOP FEATURESwww.it-ebooks.info// Output the title before filtering occursprintf("Title before filters: %s ", $title);// Remove profanity from the title$title = $profanity->removeProfanity($title);printf("Title after WJG\Clean: %s ", $title);// Remove white space and capitalize title$title = $filter->filterTitle($title);printf("Title after TP\Clean: %s ", $title);?>Executing this script produces the following output:Title before filters: the idiotic sun also risesTitle after TP\Clean: the shortsighted sun also risesTitle after WJG\Clean: The Shortsighted Sun Also RisesSummaryThis and the previous chapter introduced you to the entire gamut of <strong>PHP</strong>’s OOP features, both old andnew. Although the <strong>PHP</strong> development team was careful to ensure that users aren’t constrained to thesefeatures, the improvements and additions made regarding <strong>PHP</strong>’s ability to operate in conjunction withthis important development paradigm represent a quantum leap forward for the language. If you’re anold hand at OOP, I hope these last two chapters have left you smiling ear to ear over the long-awaitedcapabilities introduced within these pages. If you’re new to OOP, the material should help you to betterunderstand many of the key OOP concepts and inspire you to perform additional experimentation andresearch.The next chapter introduces a powerful solution for efficiently detecting and responding tounexpected operational errors which may crop up during your website’s execution, known asexceptions.174

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!