Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Ciągi - gdzie doczytać temat
adi456
post 21.07.2011, 00:31:41
Post #1





Grupa: Zarejestrowani
Postów: 251
Pomógł: 0
Dołączył: 21.01.2010
Skąd: Nowy Sącz

Ostrzeżenie: (0%)
-----


próbuje stworzyć operacje na ciągach:

z tego
  1. <tr height=\"19\" style=\"height: 14.4pt;\">
  2.  
  3. <td class=\"xl65\" height=\"19\" style=\"height: 14.4pt; width: 48pt;\" width=\"64\">
  4.  
  5. test</td>
  6.  
  7. <td align=\"right\" class=\"xl65\" style=\"border-left: medium none; width: 48pt;\" width=\"64\">
  8.  
  9. 1</td>
  10.  
  11. <td align=\"right\" class=\"xl65\" style=\"border-left: medium none; width: 48pt;\" width=\"64\">
  12.  
  13. 2</td>
  14.  
  15. <td align=\"right\" class=\"xl65\" style=\"border-left: medium none; width: 48pt;\" width=\"64\">
  16.  
  17. 3</td>
  18.  
  19. <td align=\"right\" class=\"xl65\" style=\"border-left: medium none; width: 48pt;\" width=\"64\">
  20.  
  21. 6</td>
  22.  
  23. <td class=\"xl65\" style=\"border-left: medium none; width: 48pt;\" width=\"64\">
  24.  
  25. &nbsp;</td>
  26.  
  27. </tr>
  28.  
  29. <tr height=\"19\" style=\"height: 14.4pt;\">
  30.  
  31. <td class=\"xl65\" height=\"19\" style=\"height: 14.4pt; border-top: medium none;\">
  32.  
  33. test2</td>
  34.  
  35. <td align=\"right\" class=\"xl65\" style=\"border-top: medium none; border-left: medium none;\">
  36.  
  37. 23</td>
  38.  
  39. <td align=\"right\" class=\"xl65\" style=\"border-top: medium none; border-left: medium none;\">
  40.  
  41. 34</td>
  42.  
  43. <td align=\"right\" class=\"xl65\" style=\"border-top: medium none; border-left: medium none;\">
  44.  
  45. 45</td>
  46.  
  47. <td align=\"right\" class=\"xl65\" style=\"border-top: medium none; border-left: medium none;\">
  48.  
  49. 56</td>
  50.  
  51. <td class=\"xl65\" style=\"border-top: medium none; border-left: medium none;\">
  52.  
  53. &nbsp;</td>
  54.  
  55. </tr>


chciałbym mieć tablice

  1. $test[0]=1;
  2. $test[1]=2;
  3. $test[2]=3;
  4. $test[3]=6;
  5. $test2[0]=23;
  6. $test2[1]=34;
  7. $test2[2]=45;
  8. $test2[3]=56;


gdzie mogę przeczytać jak to zrobić?

na chwile obecną poprzez
  1. explode('</td><td', $_POST['tresc']);


łapie 1 tablice
  1. Array ( [0] =>
  2. test 1 2 3 6
  3. test2 23 34 45 56
  4.  
  5.  
  6. )


i co dalej?

Ten post edytował adi456 21.07.2011, 00:54:15
Go to the top of the page
+Quote Post
phpion
post 21.07.2011, 06:32:58
Post #2





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




preg_match_all
Go to the top of the page
+Quote Post
adi456
post 21.07.2011, 11:52:38
Post #3





Grupa: Zarejestrowani
Postów: 251
Pomógł: 0
Dołączył: 21.01.2010
Skąd: Nowy Sącz

Ostrzeżenie: (0%)
-----


robie tak

  1. preg_match_all('\">*</td>', $_POST['tresc'], $wynik);
  2. print_r($wynik);


i nie wiem jak te znaczki poukładać '\">*</td>' , chciałbym wyciągnąć tekst lub liczby z pomiędzy \"> a </td>

może ktoś coś podpowie? gdzie mogę poczytać na temat tych znaczków co które znaczą i jak je układać żeby to śmigało

Ten post edytował adi456 21.07.2011, 11:56:39
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 24.07.2025 - 20:34