Welcome! 🙂
First, PHP doesn't respond to the button press. The browser does and sends a request to the server which runs PHP. Second, PHP and JavaScript don't work together since PHP is server side and JavaScript is client side.
To answer your questions:
It really all depends on how you want to do this. You could use PHP to generate a JavaScript array and use a JavaScript function to iterate the images onclick, or you could force a page reload by using links. The former is the most preferred in today's "Web 2.0" world.
You can't since PHP doesn't run on the browser, like JavaScript. Therefore you would need a JavaScript function to do this for you.
i.e.
<?php
$images = array('1.jpg', '2.jpg', '3.png');
echo '<script type="text/javascript">';
echo 'var images = ['.implode(', ', $images).'];';
echo 'var current = 0';
echo 'function changeImage(element, shift){';
echo 'current += shift;';
echo 'document.getElementById(\'element\').src = images[current];';
echo '}';
echo '</script>';
echo '<img src="images/previous.jpg" onclick="changeImage(\'image\', -1)" />';
echo '<img src="images/'.$images[0].'" id="image" />';
echo '<img src="images/next.jpg" onclick="changeImage(\'image\', 1)" />';
That should probably be in a more HTML form, but you should get the idea ... untested.