PHP can't do this because it doesn't know what a "window" is.
Javascript could do it, though. Something like
<script type="text/javascript">self.close();</script>
Though you'll probably need to search the net a bit to see how Javascript does timers (I can never remember, so that's what I end up doing every time I need to do it. SetTimeout() or something like that.)