To debug you should print what’s in $entry.
echo '<pre>' . print_r($entry,true) . '</pre>';
die();//You may need to kill the script to view..
Or email to yourself in your current mail function.
$message="<pre>" . print_r($entry,true) . '</pre>';