CakeFest 2025 Madrid: The Official CakePHP Conference

Voting

: min(six, seven)?
(Example: nine)

The Note You're Voting On

tim at weird spots in my crotch dot com
17 years ago
@Royce

I think this is better, since you can still use the ampersand in your text:

<?php
function HtmlEntitySafeSplit($html,$size,$delim)
{
$pos=0;
for(
$i=0;$i<strlen($html);$i++)
{
if(
$pos >= $size && !$unsafe)
{
$out.=$delim;
$unsafe=0;
$pos=0;
}
$c=substr($html,$i,1);
if(
$c == "&")
$unsafe=1;
elseif(
$c == ";")
$unsafe=0;
elseif(
$c == " ")
$unsafe=0;
$out.=$c;
$pos++;
}
return
$out;
}
?>

<< Back to user notes page

To Top