# Display data form array \[problem\]

**URL:** <https://forum.kirupa.com/t/display-data-form-array-problem/219823>\
**Category:** Uncategorized\
**Created:** [March 20, 2007, 2:37pm UTC](https://forum.kirupa.com/t/display-data-form-array-problem/219823 "2007-03-20T14:37:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vectar](https://avatars.discourse-cdn.com/v4/letter/v/b2d939/32.png) [@Vectar](https://forum.kirupa.com/u/Vectar)\
**Post date:** [March 20, 2007, 2:37pm UTC](https://forum.kirupa.com/t/display-data-form-array-problem/219823/1 "2007-03-20T14:37:31Z")

</div>

Hi i am studying a book on PHP and they made me write a script that could display data from a array with [Key] and [Value] trick.  
When i upload it to my lycos server it doesn’t display the array data.

this is the script:

```auto

<html>
<head>
<title>Arrays sorteren</title>
</head>
<body>
<?php
$Cijfers = array(
    "Richard"=>"95",
    "Willem"=>"82",
    "Ton"=>"98",
    "Frans"=>"87",
    "Melissa"=>"75",
    "Jaap"=>"85"
);
print ("Het array ziet er origineel zo uit:<BR>");
for ($n = 0; $n < count($Cijfers); $n++) {
    $Regel = each ($Cijfers);
    print ("Het cijfer van $Regel[Key] is $Regel[Value].<BR>
");
}
arsort($Cijfers);
reset($Cijfers);
print ("<P>Het array ziet er zo uit nadat het op waarde is gesorteerd met arsort():<BR>");
for ($n = 0; $n < count($Cijfers); $n++) {
    $Regel = each ($Cijfers);
    print ("Het cijfer van $Regel[Key] is $Regel[Value].<BR>
");
}
ksort($Cijfers);
reset($Cijfers);
print ("<P>Het array ziet er zo uit nadat het op sleutel is gesorteerd met ksort():<BR>");
for ($n = 0; $n < count($Cijfers); $n++) {
    $Regel = each ($Cijfers);
    print ("Het cijfer van $Regel[Key] is $Regel[Value].<BR>
");
}
?>
</body>
</html>

```

This is the url to the file online:  
[http://www.vectar.nl/PHP/Hoofdstuk\_7/sorteren.php](http://www.vectar.nl/PHP/Hoofdstuk_7/sorteren.php)

Can someone tell me what the problem could be ?

Lycos supports PHP5 and the [Key] and [Value] trick is a PHP4 feature so it should work in PHP5 i think ?

Please help me out

Thanks in advance
