Try successive methods until OK in PHP -
i create object using different methods in given order. goal try these methods until find 1 returns different null.
$a = method_1(); if(!$a) $a = method_2(); if(!$a) $a = method_3(); ... if(!$a) print "error";
until then, doing using imbricated if-else structures. there more "elegant" way program ?
Comments
Post a Comment