Re: Finding split points in an article for inserting ads

From: Date: Wed, 16 Feb 2011 04:26:01 +0000
Subject: Re: Finding split points in an article for inserting ads
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-311356@lists.php.net to get a copy of this message
On Feb 15, 2011, at 4:32 PM, Brian Dunning wrote:
Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote:
Assuming you're only using <p> tags, count the number of opening <p> tags, divide by three. First ad block goes after the round($amount/3)-th </p>, second ad block goes after the round($amount/3*2)-th </p>. --- Simon Welsh
Dear list, I want to extend the original question to a discussion about the relative merits of doing this within PHP vs. doing it afterwards in JavaScript. I can see arguments for both sides, so I would like get opinions from others on this tradeoff.

« previous php.general (#311356) next »