Hey I came across another neat algorithm in a textbook today.
Euclid's Algorithm for finding the gcd. Attached you'll find a php script that contains a little article about the algorithm and a working example.
Not Found The requested URL /test/<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>C:\webpage\webpage\test\art_example.php</b> on line <b>106</b><br /> was not found on this server. Apache/2.0.47 (Win32) PHP/5.0.0b2-dev Server at localhost Port 80
darn it forgot about register globals, I'll make it $_SERVER['PHP_SELF'] later.
updated to fix the error that moonglobe pointed out.