Re: [PHP] How to download a file (with browser) using fsockopen() ?

2008-02-04 Thread venkatk
Try this, it should work. //Get the file from the remote location function getFile($host, $resource, $port) { ??? $hdr = ''; ??? $file_cont = ''; ??? $fh = fsockopen($host, $port, $errno, $errstr, 300); ??? ??? if(! $fh) ??? { ??? ??? return error; ??? } else { ??? ??? $hdr .= GET /$resource

Re: [PHP] String Issue

2008-01-23 Thread venkatk
Hi, Try this: $str = 'HTMLFiles/MenuDisplay.php?var=Thai%20ImageItem=1797Action=add'; $str = preg_replace(/(\Item.*)$/,REPLACEMENT STRING, $str); this should work. Cheers, V -Original Message- From: Johny Burns [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thu, 24