codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
<?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); ?>
Private
[
?
]
Run code
Submit