Script feedback: insert string into another string

From: Date: Sat, 28 Apr 2007 05:32:10 +0000
Subject: Script feedback: insert string into another string
Groups: php.general 
Request: Send a blank email to php-general+get-254046@lists.php.net to get a copy of this message
Hi, I pieced-together a script that will insert a string into another string at a set interval of words... See here: <http://www.ambiguism.com/sandbox/truncate/truncate.php> [Click the "view source" link to view source.] :D Basically, I need a setup a page where my client can paste an article, automate the insertion of a template tag (in this case: {page_break}) and then copy/paste into the blog/cms. My goal for this script was to make it easy for the CMS to create word-balanced pages. Long story short, I got what I think will be an acceptable script... but I would love to get feedback. What do you think? What can I improve? What am I doing wrong? The script does not need to be super-robust, but would love to hear what the PHP gurus have to say. ;) Many thanks in advance! Cheers, Micky -- Wishlists: <http://snipurl.com/1gqpj> Switch: <http://browsehappy.com/> BCC?: <http://snipurl.com/w6f8> My: <http://del.icio.us/mhulse>

« previous php.general (#254046) next »