IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1982.49 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-25
[00:00]<jnnnc>nvm its workin now
[00:01]<tml>`Mace: On my hardware, this appears to run slightly faster than looping over characters: $foo = "uPpErCaSEstrINg"; $a = array_filter(str_split($foo), "ctype_upper"); sizeof($a);
[00:01]<tml>73ms vs. 76ms for: $foo = "uPpErCaSEstrINg"; $l = strlen($foo);for($i=0; $i<$l; $i++) { if (ctype_upper($foo[$i])) ++$c; }
[00:01]<fwyezzmf>if i wanted to upload an image in php <input type="file" name="coverpicture" />would this how I would display it back ? I tried <?php echo $_FILE["coverpicture"]; ?> and all this does is display the filename, i'm trying to get the the image to display
[00:02]<jnnnc>oh
[00:02]<tml>lwizardl: php.net/features.file-upload goes over the $_FILE array
[00:02]<tml>lwizardl: If you want to display the file, you need <img src="<?php echo $_FILE["coverpicture"]; ?>" />
[00:02]<`mran>TML, and there i was using a for loop.
[00:02]<`mran>thanks
[00:02]<syfyrrvn>lwizardl: you'd need to put it in an image link <img src="<?php echo $_FILE["coverpicture"]; alt="image"?>"><?img>
[00:03]<syfyrrvn>yeah what TML said
[00:03]<tml>`Mace: *shrug* It's 3ms.
[00:03]<syfyrrvn>heh
[00:03]<gzrxrdc>Wolfpaws: i got it
[00:03]<fwyezzmf>Silicate, thanks
[00:03]<tml>`Mace: in other words, use the one that is more clear code-wise, because the speed difference isn't significant
[00:04]<jnnnc>ah yah that whats what I had planned originally TML but didnt know the correct functions
[00:05]<tml>Jezek: What?
[00:05]<jnnnc>nvm
[00:06]<`mran>TML, every little helps. :)
[00:06]<`mran>I will steal it in that case then. Thanks again
[00:06]<jnnnc>i tried :(
[00:06]<`mran>Man I need sleep! heh!
[00:12]<tra>has anyone in here used quanta? I can not figure out the CVS integration, but this is looking like a decent IDE ....
[00:13]<amnnf>im using php/smarty and css for the layout.. but in IE, whenever i refresh the page, it doesnt display the complete page instead displays a part of it and then shows the broken html tags... when i hard refresh it using ctrl + f5, it displays it correctly
[00:16]<jnnnc>someone said I could do $this->image = switch($ext) { etc.. but when I do it says
[00:16]<jnnnc>Parse error: syntax error, unexpected T_SWITCH in /home/cristel6/public_html/classes/main.class.php on line 774
[00:16]<jnnnc>am I doing it wrong?
[00:17]<syfyrrvn>Jezek: yes
[00:17]<jnnnc>so how should I be doing it?
[00:17]<jnnnc>I know you can put in within each case but I cant do it this way?
[00:19]<amnnf>is there a buffer size defined
[00:19]<syfyrrvn>switch ($ext) { case 'jpeg' : $this->image = imagegetfromjpeg($file); break; case 'gif' : $this->image = imagegetfromjpeg($file);break; default: }
[00:19]<jnnnc>I knew you could do it that way but thx I guess..
[00:20]<syfyrrvn>If it was me I'd do $Command = 'imagegetfrom'.$ext; if (function_exists($Command)) $this->image = $Command($file);
[00:21]<jnnnc>wow. i was having this big talk with someone and they said I couldnt do it that way
[00:21]<jnnnc>ok ill do that
[00:24]<jnnnc>ah. so much easier this way
[00:25]<syfyrrvn>just as a note, the function should be imagecreatefrom, not imagegetfrom ... doing off the top of my head
[00:26]<jnnnc>except if someone had a file that had a .jpg extension it would try to do imagecreatefromjpg, and doesnt it have to be imagecreatefromjpeg?
[00:26]<syfyrrvn>dread, think about it
[00:26]<syfyrrvn>you can either block them if they don't have the right extension of you can convert it
[00:27]<syfyrrvn>you shouldn't just let them upload any old extension anyway
[00:27]<jnnnc>I know
[00:27]<jnnnc>i have it set as only images
[00:27]<tml>You shouldn't rely on what the browser says the extension is
[00:27]<syfyrrvn>yeah exactly
[00:27]<jnnnc>ok so how would I .. convert it
[00:28]<tml>You should use getimagesize()
[00:28]<jnnnc>..
[00:29]<syfyrrvn>yeah that is a better way for sure TML
[00:29]<xrfcndn>can someone suggest the best way to parse out 2006-06-15T05:47:50.80889Z in php4? strtotime returns -1
[00:29]<jnnnc>I dont understand
[00:29]<jnnnc>oh nvm
[00:30]<syfyrrvn>Jezek, did you look up getimagesize in the manual?
[00:30]<jnnnc>yah i just saw that part
[00:30]<syfyrrvn>great, you should be able to figure out the rest from the manual and what we have given you so far
[00:30]<jnnnc>yep
[00:30]<jnnnc>thx guys
[00:31]<vxn-nzd>halkeye: that's a weird time. give me a minute or 2 I'll write out a reg.
[00:31]<syfyrrvn>in fact if you look at the second user note, you will see a similar thing done that you are trying to accomplish
[00:31]<tml>halkeye: explode() on 'T', 0 is the date, 1 is the time
[00:31]<xrfcndn>the-erm, its iso 8601 format
[00:32]<jnnnc>oh yah. cool
[00:32]<xrfcndn>TML, php still doesn't like the . seconds, nor the Z for timezone
[00:32]<vxn-nzd>I guess that's another way of doing it.
[00:32]<syfyrrvn>halkeye: strtotime parses it for me
[00:32]<xrfcndn>Silicate, php5? or 4?
[00:32]<xrfcndn>4 returns -1
[00:32]<syfyrrvn>oh
[00:32]<xrfcndn>5 has been fixed
[00:32]<syfyrrvn>upgrade ;)
[00:33]<syfyrrvn>haha
[00:33]<tml>halkeye: I was giving you a start, not doing it for you.
[00:33]<xrfcndn>yea, and i could do a regex and pass in into mktime
[00:33]<xrfcndn>which would be better than an explode
[00:34]<syfyrrvn>okay, I gotta go get ming so I can complie PDO_user
[00:36]<tml>halkeye: You and I have different definitions of "better"
[00:37]<syfyrrvn>halkeye:The only thing wrong with that date code is the 'Z'
[00:38]<xrfcndn>and the decimal
[00:38]<syfyrrvn>php4 parses it okay if you chop that off
[00:38]<syfyrrvn>yeah sorry
[00:39]<syfyrrvn>halkeye: will the timezone ever not be zulu?
[00:39]<xrfcndn>no
[00:39]<xrfcndn>i don't think so
[00:39]<syfyrrvn>so then explode on the .
[00:39]<syfyrrvn>or substr | strpos
[00:40]<xrfcndn>yea, i was more worried about getting the timezone right
[00:40]<syfyrrvn>I dunno, sounds like you pretty much know what you are doing - there are 20 solutions. pick one and play with it
[00:51]<vxn-nzd>halkeye: http://pastebin.com/729368
[00:51]<vxn-nzd>for what it's worth
[00:54]<xrfcndn>the-erm, oh, thanks
[00:54]<jfznzn0w>hi all, will unset($_COOKIE['username']; unset a cookie?
[00:55]<zn2us_zmc>id it possible to take a frame from wmv file just using PHP?
[00:55]<wjlllrws>olger901: no... Read php.net/setcookie
[00:56]<jdddd>rebus_rdk: You wish!
[00:56]<zn2us_zmc>yeah i do :)
[00:56]<wjlllrws>rebus_rdk: It is, but you have to write the decoder for wmv first.
[00:57]<jdddd>rebus_rdk: No video functionality in php.
[00:57]<zn2us_zmc>i saw that going thru doc's but it never hurts to ask...







