( [0] => stdClass Object ( [id] => 1 [typ] => tw [zestaw] => po,ok:mi,or:te,do:bi,ok:sp ) [1] => stdClass Object ( [id] => 2 [typ] => tw [zestaw] => po,ok:mi,or:te,do:bi,sp:la,do:bi,ok:sp ) [2] => stdClass Object ( [id] => 3 [typ] => tw [zestaw] => po,or,do:bi ) [3] => stdClass Object ( [id] => 4 [typ] => tw [zestaw] => pr,po,ok:ma,or,ok:pa ) [4] => stdClass Object ( [id] => 5 [typ] => tw [zestaw] => po,pr:pr ) [5] => stdClass Object ( [id] => 7 [typ] => py [zestaw] => py,po,ok:pa,ok:sk,or,do:bi ) [6] => stdClass Object ( [id] => 8 [typ] => py [zestaw] => py,pr,po,or ) [7] => stdClass Object ( [id] => 9 [typ] => py [zestaw] => py,po,or ) )
Potrzebuję ją podzielić ze wzlędu na [typ] (są tu akurat tylko 2), potem rodzielić wszystko w [zestaw]'ie i popodmieniać te wartości.
Ma to wyglądać tak:
explode 'zestaw' wg "," (przecinka), a potem jeszcze rozbicie tego na mniejsze tabele wg ":" (dwukropka).
Daje mi to coś takiego:
( [0] => po ) ( [0] => ok [1] => mi ) ( [0] => or [1] => te ) ( [0] => do [1] => bi ) ( [0] => ok [1] => sp ) ( [0] => po ) ..................itd
I teraz pytanie: jak za pomcą np str_replace (o ile tak sie da) podmienić wartości tych elementów. Np "po" zamienić na "podmiot" itd? [struktura tabeli moze pozostac ta sama]