macros - Include code from different function in PHP -
i have library c i'm adapting php. there no macros in php, need similar. let me give quick example:
function check($test){ if($test == false) return; }
and call such function inside few times:
function checks(){ check(0==1); check(1==1); ... }
and i'd want checks function stop after first test. please note not i'm trying do, example can understand i'm looking for. return statement in "check" should make function "checks" return.
thanks in advance.
how this..,
<?php function check($test) { if($test == false) { //do something.. exit(); } } function checks() { check(1 == 1); echo "1 done..</br>"; check(2 == 2); echo "2 done..</br>"; check(0 == 0); echo "3 done..</br>"; check(1 == 2); echo "4 done..</br>"; check(1 == 0); echo "5 done..</br>"; check(2 == 1); echo "6 done..</br>"; } checks(); ?>
Comments
Post a Comment