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: 1952.40 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-07-24
[00:00]<[w]vncj2dvn>right, sorry. lol. that was a typo...
[00:00]<20fv>i know that it's possible for a class to be a member of another class
[00:00]<20fv>what's the error you're getting?
[00:01]<[w]vncj2dvn>for this line: public $formatDesc = new scriptFormatDesc();
[00:01]<20fv>yeah
[00:01]<[w]vncj2dvn>i'm getting Parse error: parse error, unexpected T_NEW in d:\active\screenplay\content\index
[00:01]<[w]vncj2dvn>.php on line 38
[00:01]<20fv>oh
[00:01]<20fv>use public $formatDesc;
[00:01]<ajfmnz>[1]tekobyte, class member's default value must be constant expressions
[00:02]<20fv>and in __construct()
[00:02]<20fv>set it there
[00:02]<20fv>what colder said
[00:02]<[w]vncj2dvn>oh, ok. thanks
[00:02]<ajfmnz>you can't use new .., operators, heredoc, as class member's default value
[00:04]<vncj2dvn>yup, thanks very much! that fixed it. (of course, lol)
[00:05]<bgg`>how would you check where a URL gets redirected?
[00:05]<vncj2dvn>now, in c++, if I remember correctly, if you used new in a constructor, you had to delete it with the destructor. is that the case with php?
[00:05]<rcrgjwg>what is a comercial license means? i cant sell products with this software? or i cant work with inside my company? like developing with this software to sell a service not another software
[00:05]<vncj2dvn>akano1n> what is a comercial license means? i cant sell products with this software? or i cant work with inside my company? like developing with this software to sell a service not another software
[00:05]<vncj2dvn>[14:03] *** GwaiLo quit (Read error: 110 (Connection timed out))
[00:06]<bgg`>a URL being redirected with a location header
[00:06]<njdycjs>Ben`: look at the response headers when you request it
[00:06]<vncj2dvn>oops, sorry
[00:06]<bgg`>Nomikos, how do you do that?
[00:06]<rcrgjwg>heheh
[00:06]<njdycjs>Ben`: you want this done in PHP?
[00:06]<bgg`>yeah
[00:07]<rlurrsnw7>so since $i++ adds 1 to an integer, does $i-- subtract 1 from an integer?
[00:07]<njdycjs>Ben`: request the url with curl, set CURLOPT_HEADER to true with curl_setopt, and examine the returned headers
[00:08]<bgg`>can I do it without curl?
[00:08]<-- 2yd2nzy xrs fuyv>http://iownmymusic.org/ http://iownmydvds.org/ .")
[00:08]<vxn-nzd>CLucas916: yes
[00:08]<20fv>if you want to use sockets
[00:08]<rlurrsnw7>the-erm: thanks
[00:08]<[i]gpnat>CLucas916 yes but ++$i and $i++ are different
[00:08]<bgg`>how would I check it with sockets?
[00:08]<rlurrsnw7>[I]nfecT: how so?
[00:09]<20fv>Ben`, pretend to be an http client
[00:09]<[i]gpnat>pre and post increment
[00:09]<rlurrsnw7>k
[00:09]<njdycjs>Ben`: it's the only php function i know that will show you http headers from requested data, but i may be wrong..
[00:09]<vncj2dvn>creating a new instance of a class within other classes constructor using the "new" keyword, do you have to delete the instance in the destructor, or does php handle that itself?
[00:11]<20fv>++$i is faster than $i++ by a few microseconds
[00:11]<fusxuyrr>b0lt: ...
[00:12]<rlurrsnw7>lol
[00:12]<m2n>How can I use something like: $row["foox"]=str_replace(" ","_", $row["foo"]); strtolower($row["foo"]); ?
[00:12]<vxn-nzd>Well that's great to know if I ever design a site that gets 1,000,000+hits a month.
[00:13]<20fv>Fushuing, it is
[00:13]<ajfmnz>dbe, strtolower return the resulting string, so you need to use $var = strtolower($var);
[00:13]<vxn-nzd>ya
[00:14]<drvnqc9>how can I strip a set amount of characters from the beginning and end of a string?
[00:14]<m2n>colder, I want $foox to replace space with underscore and set all characters to lowercase.
[00:14]<fusxuyrr>who cares about those miliseconds!
[00:14]<fusxuyrr>my forum runs at 0.000005 ms :X
[00:14]<fusxuyrr>and it's not optimized yet :/
[00:14]<vncj2dvn>does php automatically delete/remove from memory a variable or instance of a class created in a classe's constructor?
[00:14]<20fv>tekobyte, when the class is destructed, yes
[00:14]<m2n>Fushuing, That's a shame, 0.000005 ms takes for ever ;).
[00:15]<juhp|snzvyan>in my php.ini how can i change: Registered save handlers files user sqlite
[00:15]<vncj2dvn>okee, thanks :) in C++, everything is manual, so if you don't delete it, then eventually the memory fills up
[00:15]<juhp|snzvyan>to be "files user" instead of "files user sqlite" ?
[00:15]<fusxuyrr>i know :/
[00:15]<fusxuyrr>the script must be loaded before it loads!
[00:15]<fusxuyrr>that was a CAD-reference for the non-geeks :/
[00:17]<juhp|snzvyan>in my php.ini how can i change: "Registered save handlers - files user sqlite" to "files user" ?
[00:18]<juhp|snzvyan>Registered save handlers - files user sqlite is returned with phpinfo();
[00:21]<m2n>colder, $foo="Hello World"; $bar=str_replace(" ","_", $foo) && $bar=strtolower($foo); echo $bar; won't work, so what am I doing wrong?
[00:21]<ajfmnz>don't why are you using && ?
[00:21]<ajfmnz>s/don't//
[00:21]<m2n>colder, How should I set it then?
[00:21]<ajfmnz>$bar=str_replace(" ","_", $foo); $bar=strtolower($foo);
[00:23]<m2n>colder, That won't replace space with _.
[00:23]<vxn-nzd>it would make bar replaced....
[00:24]<ajfmnz>dbe, why wouldn't it ?
[00:24]<ajfmnz>ah
[00:24]<vxn-nzd>maybe something like $bar = str_replace(' ','_',strtolower($foo)); // is what you want.
[00:24]<ajfmnz>$bar=str_replace(" ","_", $foo); $bar=strtolower($bar);
[00:25]<m2n>the-erm, Thank you.
[00:25]<vxn-nzd>colder's example would work as well.
[00:25]<wdrrvs>Is there a way to get the last item in an array?
[00:25]<wdrrvs>pop?
[00:25]<ajfmnz>wycats, $element = end($array);
[00:25]<vxn-nzd>... end() ///
[00:26]<m2n>Yes it did, thx colder
[00:27]<wdrrvs>I tried [-1], but it didn't work :(
[00:27]<njdycjs>nice try though :-)
[00:27]<wdrrvs>end works fine
[00:27]<vxn-nzd>Wouldn't that look up the key ["-1"]
[00:27]<wdrrvs>there's no way to go backwards in an array, right?
[00:28]<vxn-nzd>There's got to be a way using array_pop, shift unshift or something.
[00:28]<njdycjs>wycats: prev() but i've never used it
[00:28]<vxn-nzd>let me take a look at those functions really quick ... I forget.
[00:29]<vxn-nzd>ya the best way would be while ($element = array_pop($array)) { // do some stuff with the element. }
[00:30]<vxn-nzd>bad news is you can't get the $key.
[00:30]<ajfmnz>the-erm, nah, you won't be able to pop out an element that evaluates to false
[00:31]<vxn-nzd>I'm thinking if you wanted it to loop thru all the elements.
[00:31]<vxn-nzd>bottom to top.
[00:31]<njdycjs>wycats: maybe you can use foreach(array_reverse($arr, 1) as $key => $value) { ..







