Fopen() timeout

hi,

how do i modify the timeout value for a call to fopen() in php. in my script i open a bunch or urls and if the file is temporarily unavailable the script sits there for about 3 minutes trying to open the thing when it’s obviously not there. how can i make this timeout value something like 5 seconds. can i do it in my .htaccess?

thanks