This is impossible with PHP. PHP is on the server.
Info about server side
Info about javascript client side scripting
Javascript can easily accomplish this for you. See this question
Like I said, this is impossible with PHP alone, here’s some php that echos the javascript.
In your section
echo '
<script type="text/javascript" language="javascript">
function convertEnterToTab() {
if(event.keyCode==13) {
event.keyCode = 9;
}
}
document.onkeydown = convertEnterToTab;
</script>
';