Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brcontainer/f85ff8dc606840d77803b04cabc2b24e to your computer and use it in GitHub Desktop.
Save brcontainer/f85ff8dc606840d77803b04cabc2b24e to your computer and use it in GitHub Desktop.
<?php
...
$limite = AQUI VAI O VALOR DO BANCO;
$txt = preg_replace_callback('#(<br />)#', function ($i) use ($limite) {
static $conta1 = 0;
$retorno = $i[0];
if(++$conta1 == $limite)
{
$retorno .= '<b>BANNER 1</b>';
}
return $retorno;
}, $conteudo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment