Dooling Posted November 13, 2007 Report Share Posted November 13, 2007 (edited) Ir vairāki masīvi, kuri tiek padoti. Piemēram: Array ( [0] => atbilde|09.02.2007.|1 ) Array ( [0] => atbilde|10:40|2 [1] => atbilde|11:20|2 ) Man vajag katru šo masīvu split'ot. Kā to panākt ar funkciju split(), atdalītājs ir "|"? P.S. Atradu risinājumu. Dzēsiet ārā šo topiku. Atrisināju izmantojo foreach($val as $key => $value) Edited November 13, 2007 by Dooling Link to comment Share on other sites More sharing options...
marcis Posted November 13, 2007 Report Share Posted November 13, 2007 jāsaka, ka par šādiem ļaužiem gandrīz vai prieks :) Link to comment Share on other sites More sharing options...
Paulinjsh Posted November 13, 2007 Report Share Posted November 13, 2007 explode split vietā nebūs ātrāks? Link to comment Share on other sites More sharing options...
Dooling Posted November 13, 2007 Author Report Share Posted November 13, 2007 Jā, pagūglējot un palasot ko citi saka, tad explode tiešām ir ātrāks par split. Būs jānomaina ;) Link to comment Share on other sites More sharing options...
Paulinjsh Posted November 13, 2007 Report Share Posted November 13, 2007 nu kā bubu saka nevajaga šaut ar lielgabalu pa zvirbuļiem. Link to comment Share on other sites More sharing options...
andrisp Posted November 13, 2007 Report Share Posted November 13, 2007 Dooling, būtu pieticis, ja split() manuāļa lapu būtu papētījis sīkāk ;) preg_split(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to split(). If you don't require the power of regular expressions, it is faster to use explode(), which doesn't incur the overhead of the regular expression engine. Link to comment Share on other sites More sharing options...
Dooling Posted November 13, 2007 Author Report Share Posted November 13, 2007 jā, tiešām nevajadzēja pat gūglēt :D Link to comment Share on other sites More sharing options...
Recommended Posts