includes/clientside/static/misc.js
changeset 581 5e8fd89c02ea
parent 550 685e839d934e
equal deleted inserted replaced
580:41c45314ac27 581:5e8fd89c02ea
   637 function explode(needle, haystack)
   637 function explode(needle, haystack)
   638 {
   638 {
   639   return haystack.split(needle);
   639   return haystack.split(needle);
   640 }
   640 }
   641 
   641 
       
   642 /**
       
   643  * Equivalent to PHP's in_array function.
       
   644  */
       
   645 
       
   646 function in_array(needle, haystack)
       
   647 {
       
   648   for(var i in haystack)
       
   649   {
       
   650     if(haystack[i] == needle) return i;
       
   651   }
       
   652   return false;
       
   653 }
       
   654 
   642 addOnloadHook(expander_onload);
   655 addOnloadHook(expander_onload);