Apply for Zend Framework Certification Training


$class_fees = array('Pre Nursery'=>'100','Nursery'=>'100','
Upper K G'=>'150','1'=>'200','2'=>'250','10'=>'500');

$class_name = 'Pre Nursery';
$class_fees = isset($class_fees [$class_name]) ? $class_fees [$class_name] : 0;

In this case what we are doing is we are looking for 'Pre Nursery' class fees 
 and if found it will return fees if not will return 0


   viewers usually we are in a situation to match an index of an array and to return its value
lets take a case of fees of class where in array index is a name of class
and the value is their fees so in order to match class and return their fees
we can use different approach.

< Export data to excel in php using mysql what is the difference between a method and a function >

Ask a question

  • Question:
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question

Back to Top