Posted By

sb_01 on 10/12/10


Tagged


Versions (?)

isDefine - isset & empty function


 / Published in: PHP
 

  1. function isDefine($str) {
  2. if(is_array($str)){
  3. foreach($str as $key => $value) {
  4. if(isset($str[$key]) and !empty($str[$key])) {
  5. $res[] = true;
  6. } else {
  7. $res[] = false;
  8. }
  9. if(array_search(false, $res) === true) {
  10. return false;
  11. }
  12. }
  13. } else {
  14. if(isset($str) and !empty($str)) {
  15. return true;
  16. }
  17. }
  18. return false;
  19. }

Report this snippet  

You need to login to post a comment.