PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$j is never incremented in any part of your function, thus $uarray will only ever have one indice ($uarray[0]) which will contain whatever the latest value of $val will be.
Therefore when you assign the return value of the function to $myarr, it too will only contain one idice with the the key '0'