Firstly, As i make out. You want to get the product info like it's name and ID.
1- if you want to fetch the product name it can be done by two method.
First - example:
$print = getData(323);
by using array key so what you have to do just.
Second example -
if you don't want to use the array key then just use any one loop. like see example below
foreach ($print as $print ):
echo $print [product];
output - samsung.
try this! may be you will get the point