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.
print_r($print [0][product]);
output: samsung.
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];
endforeach;
output - samsung.
try this! may be you will get the point