Re: Finding split points in an article for inserting ads

From: Date: Tue, 15 Feb 2011 23:50:08 +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-311346@lists.php.net to get a copy of this message
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 Try substr_count ?? Cheers -- David Robley Sure, it's clean laundry. The cat's sitting on it, isn't he? Today is Boomtime, the 47th day of Chaos in the YOLD 3177.

« previous php.general (#311346) next »