News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NETTUTS.com:
How to Create Blog Excerpts with PHP
July 23, 2010 @ 09:11:18

On NETTUTS.com today there's a tutorial (a screencast) that'll show you how to create excerpts for the posts in your blog. Their method could be applied to just about any PHP-based blog software out there since it uses base PHP functions and MySQL features.

Ever visited a blog, and noticed that each posting's overview only contained a hundred characters or so, which is then followed by '''? Ever wondered how to do that yourself? It's not quite as easy as you might think. What if character number 100 occurs in the middle of a word? Do you want to display half of a word on the page? Of course not. In this video tutorial, I'll show you how to compensate for this, as well as a host of other neat little things, like working with MySQL's LEFT() function, using PHP's strrpos, and substr, creating the beginning's of an actual blog, and more.

They show you how to use the MySQL LEFT() function, strrpos and substr to make creating these summary blocks of text simple.

0 comments voice your opinion now!
blog excerpt tutorial screencast mysql strrpos substr


blog comments powered by Disqus

Similar Posts

DevShed: Null and Empty Strings

DevShed: Implementing the commit() and rollback() Methods with mysqli and PHP 5

SitePoint.com: Be More Asssertive: Getting to Know PHPUnit's Assertions

ProDevTips Blog: Fluent Arrays and Strings in PHP - Adding JSON and more

HowTo Forge: Installing Lighttpd With PHP5 And MySQL Support On Fedora 7


Community Events





Don't see your event here?
Let us know!


experience symfony2 release threedevsandamaybe framework language unittest laravel podcast refactor opinion introduction list series code testing community developer interview install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework