For starters, you should format your code properly, e.g.,
function echointextarea($what, $long, $deep) {
echo "<textarea cols=\"$long\" rows=\"$deep\" wrap=\"OFF\">$what</textarea>";
}
$a1 = array("Animals", "Cars");
$e = print_r($a1);
echointextarea($e, 20, 5);
Now, one problem is that print_r is just returning true. You should make it return the string representation instead, e.g.,
function echointextarea($what, $long, $deep) {
printf('<textarea cols="%d" rows="%d" wrap="OFF">%s</textarea>',
$long, $deep, htmlspecialchars($what));
}
$a1 = array("Animals", "Cars");
$e = print_r($a1, true);
echointextarea($e, 20, 5);
Notice that I made use of printf and htmlspecialchars to escape the output.