NYCPHP Meetup

NYPHP.org

[nycphp-talk] dynamic string manipulation when web serving - best practices and ideas?

inforequest sm11szw02 at sneakemail.com
Fri Jun 11 11:21:25 EDT 2004


I would like to ask you all what are recommended techniques for dynamic 
string manipulation/insertion on my website in an AMP environment.

I have an existing mysql database of content "blah blah blah, ad nausium 
blah blah blah" served by various dynamic pages, and would like to 
modify replace certain string content under certain conditions.

I want some display-related parsing, such as "blah blah blah, <strong>ad 
nausium</strong> blah blah blah" on certain pages
I want some addition stuff in other places "blah blah blah, ad nausium 
(Ticker: <a href="">AdNaus</a>)  blah blah blah" on other pages
or outright replacement in some cases "blah blah blah, Argumentum ad 
Misericordiam  blah blah blah"
I want some security/graphic manipulations on other pages "blah blah 
blah" . <?php echo(WriteUsingGD("ad nausium")); ?> . "&nbsp; blah blah 
blah" on other pages

but in general it is always "watch for the string 'ad nauseum' and if 
you see it, do THIS before sending out to browser" where THIS may be 
generalized as a predefind (currently PHP) function on said string. The 
database text content is relatively static, while the desired 
manipulations (functions) will change frequently.

Where is it "best" to watch for/modify this content? Should it be tagged 
and post-processed, or can it be modified at the mysql query level? 
Stored procedure? Can Apache do it - with hooks back into php?

I desire to stay within AMP. Currently it is custom php coding for each 
page type served.  Thanks for any comments/suggestions/examples

John Andrews




More information about the talk mailing list