PHP数组不显示所有项目

I have this code for an array, and the problem is that it shows only two last items of the array.

$svi= array(
        $WMN1,
        $LNG1,
        $SSWN1,
        $DT1,
        $OET1,
        $OW1,
        $NT1  
    );

    $imena_sajtova = array(
        'Prvi WMN',
        'Drugi LNG',
        'Treci SSWN',
        'Cetvrti DT',
        'Peti OET',
        'Sesti OW',
        'Sedmi NT'
    );

    $novi_svi =array_combine($svi, $imena_sajtova);

    echo '<pre>'; print_r($novi_svi); echo '</pre>';

And the result of this code is:

Array
(
    [2] => Sedmi NT
    [1] => Sesti OW
)

What could be a problem? Thanks!

var_dump($svi) displays this:

array(7) { [0]=> int(2) [1]=> int(1) [2]=> int(1) [3]=> int(1) [4]=> int(2) [5]=> int(1) [6]=> int(2) }

This $svi array has results from some functions:

$WMN1=RSS_Brojac($WMN);
$LNG1=RSS_Brojac($LNG);
$SSWN1=RSS_Brojac($SSWN);
$DT1=RSS_Brojac($DT);
$OET1=RSS_Brojac($OET);
$OW1=RSS_Brojac($OW);
$NT1=RSS_Brojac($NT);

I've changed order of arrays in the array_combine, and it works!

$novi_svi =array_combine($imena_sajtova, $svi);

    arsort($novi_svi);


    echo '<pre>'; print_r($novi_svi); echo '</pre>';

And the output of this code is:

Array
(
    [Prvi WMN] => 2
    [Sedmi NT] => 2
    [Peti OET] => 2
    [Sesti OW] => 1
    [Cetvrti DT] => 1
    [Drugi LNG] => 1
    [Treci SSWN] => 1
)

I'have sorted them from high to low, that's what I actually wanted to do with this array. Now, how to separate the results, to have them in separate divs inside html? So then, I'll be able to change their style and create some kind of table with these results.

The results are output from some RSS feeds, which I use to count number of published news.

Thank you for your time!

Well there you go, the exact reason why you only retrieve two values after the array combine is because you've only supplied two unique integers, 1,2 as the indexes of the arrays to be combined. You need at least 7 unique values for your 7 strings.

Here's an example using your code and it doesn't work

And...Here's an example using 7 unique indexes, that does work

Typecast the values in the first array before merge. Can be achieved with array_map(). I assume you know the desired types in the variables.