I got this from here: http://www.gab.lc/scripts/php_my2pg.php
But it did not work for me. And since it is released under the WTFPL (http://en.wikipedia.org/wiki/WTFPL) I modified it and here you go. Use at your own risk.
I added some more data types and support for copying binary objects.