View Single Post
ישן 10-04-09, 18:42   # 6
DvirCohen
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Dec 2007
הודעות: 151

DvirCohen לא מחובר  

PHP קוד:
$string "
<font color=\"#008003\">1</font>
<font color=\"#008003\">1</font>
<font color=\"#008003\">1</font>
<font color=\"#008003\">1</font>
<font color=\"#FF0003\">2</font>
<font color=\"#FF0003\">2</font>
<font color=\"#FF0003\">2</font>
<font color=\"#FF0003\">2</font>"
;

preg_match_all('/<font color=\"#008003\">(.+?)<\/font>/'$string$matches);

print_r($matches);
/*
Array
(
    לזה אל תתייחס כי זה תופס את כל הביטוי, בעצם זה אמור להיות 1 בצבע ירוק פה
    [0] => Array
        (
            [0] => 1
            [1] => 1
            [2] => 1
            [3] => 1
        )

    [1] => Array
        (
            [0] => 1
            [1] => 1
            [2] => 1
            [3] => 1
        )

)
*/ 
  Reply With Quote