RE: [PHP] Fopen and streams

From: Date: Thu, 29 Jan 2004 15:22:35 +0000
Subject: RE: [PHP] Fopen and streams
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-176209@lists.php.net to get a copy of this message
>Secondly, where is a good place to read on the standards and formats used >by these different schemes. In the fsockopen() func, I made some writes >to 'GET / ' and 'HTTP 1.1' etc... After reading the script, I understand >what these imply, but not the importance, also, what other commmands are >available to me. Does that all make sense? I guess more simply put: How >do I know what commands are availble to me in the different protocals. >HTTP, FTP, UDP, etc...what if I wanted to get at the data through >straight TCP, is that possible? Most protocols are documented in RFC's, such as these: http://www.w3.org/Protocols/rfc2616/rfc2616.html http://ftp.ics.uci.edu/pub/ietf/http/rfc1945.html http://www.ietf.org/rfc/rfc0959.txt http://www.faqs.org/rfcs/rfc768.html http://www.ibiblio.org/pub/docs/rfc/rfc793.txt >Lastly, where should I go to read up on how to make my scripts run >faster? I haven't written anything to large, but I'm generalyy paranoid >about overhead, esp in areas I probably don't need to be worried about. >Silly questions I suppose, like, is it more efficient to echo one long >string or echo parts of it on separate lines. The latter is easier when >creating tables and such, because I can comment out individual lines to >hunt down bugs. But does it make a difference in the runtime of the >script? Etc.... Knuth's quote, "We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil", was probably intended to refer to optimizations like those. I wouldn't worry about them, especially if shaving a few milliseconds off your script is going to make it a nightmare to debug or revisit. --------------------------------------------------------------------- michal migurski- contact info and pgp key: sf/ca http://mike.teczno.com/contact.html

« previous php.general (#176209) next »