php - Shortening a "for / switch-case" -


There are 30 schools in the school system, the lowest school code is 298 and the highest is 516. For each school, similar procedures will be called. So far the approach that I have taken can be seen below. How can I shorten this code? Thank you. ($ I = 298; $ i & lt; = $ 516; $ i ++) {Switch ($ i) {Case 298: $ c_sch = strval ($ i) for

 ; // Call a function uf_mem_requester ($ c_sch, $ t_mem1, $ t_mem2, $ t_mem3, $ d_year, $ d_datadate); Case 303: // etc .... etc ..... Case 30 9: // etc .... Default ...}}  
< P>

Definitely I do not understand what is the switch because there exists some ID between 298 and 516 Are not you?

In that case, I like

  $ school_ids = array (298, 300, 304, 312, 319, 320, 321, ..... .. all school ids which actually exist); Foreign Language (school $ $ school_ids) // List of all IDs {$ c_sch = strval ($ school) exists; Uf_mem_requester ($ c_sch, $ t_mem1, $ t_mem2, $ t_mem3, d_year, $ d_datadate); }  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -