Hello,

I would like to split a String containing ingredience with additional assigned footnotes...

my problem I only get the first ingredience ($zutat at line 32 has only one times the awaited value) but the print on line 29 shows me that the value of $zutat is right at this point.

what's wrong ????

1 <?php
2
3 $products_ingredience = 'Gersten-Grütze²*, Gerstenmehl²*, Haferflocken*, Gemüse 12 % (Lauch*, Möhren*, Zwiebeln*), Haferkleie*, Steinsalz, Petersilie*, Kartoffelstärke*, Hefeextrakt, Sellerieblatt*, Kurkuma*, Muskatnuß*, Pfeffer*, Liebstöckl*';
4
5 ArtikelZutaten ($products_ingredience);
6
7
8 function ArtikelZutaten($products_ingredience) {
9
10
11 print "\n\n\n$products_ingredience)";
12 $Zutaten = explode(",", $products_ingredience);
13
14 foreach ($Zutaten as $zutat) {
15 if (preg_match("/\²/", $zutat))
16 $FussnoteID = 2;
17 else
18 $FussnoteID = '';
19
20 if (preg_match("/¹/", $zutat))
21 $FussnoteID = 1;
22
23 if (preg_match("/\*/", $zutat))
24 $kbA = 1;
25 else
26 $kbA = 0;
27
28 preg_match("/\b.*\b/", $zutat, $matches);
29 print "\n-->>$zutat";
30 $zutat = $matches[0];
31
32 print "\nZutat $zutat FussnotenID $FussnoteID kbA $kbA";
33
34 }
35
36 }
37
38 ?>




mfg - micha


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to