<?php
$custombreak = create_function('$a', 'return ($a == 3);');
$i = 0;
do {
echo $i . '<br />';
$i++;
if($custombreak($i)) break; //<-- I'd like to break the loop with a custom function.
// if ($i==3) //<-- this is not what I'm looking for
// break;
} while ($i < 10);
?>