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-05-22
[13:15]<gmnn>when I'm in a class, how can I call a function from the parent class?
[13:15]<cfjccwnrx[r]>parent::foo()
[13:15]<gmnn>thx
[13:15]<mrscm_>you can use the name of the parent class aswell cant you?
[13:17]<cfjccwnrx[r]>self, parent etc work better
[13:17]<cfjccwnrx[r]>-> if you refactor and rename your classes, your code doesn't break
[13:17]<mrscm_>yeah of course, just suggesting more options
[13:19]<grgmrg>hi can i use " ^[0-9]*\.[0-9]* " to match 234.45 ?
[13:25]<grgmrg>hi can i use " ^[0-9]*\.[0-9]* " to match 234.45 ?
[13:26]<msaxznac>have you tried?
[13:26]<grgmrg>not yet
[13:26]<grgmrg>:-)
[13:26]<msaxznac>then try it
[13:26]<msaxznac>:-)
[13:26]<ajmnvxynp>nandan: sure, but it would also match "."
[13:27]<grgmrg>codethief: i need to match dot also
[13:27]<ajmnvxynp>dunno whether this side effect is desired
[13:28]<ajmnvxynp>than it should work properly
[13:28]<zjw>nandan + is 1 or more matches * is 0 or more.
[13:28]<ajmnvxynp>*than = then
[13:28]<ajmnvxynp>@row: "<nandan> codethief: i need to match dot also"
[13:32]<wdsvnz>Is their a php command that will allow the code to read the name of the file?
[13:33]<wdsvnz>like i had randomname.php can i get a php command to read the file name is randomname.php?
[13:33]<vxndjvns>I everyone, the company I work for encode their PHP when we deploy. The thing is we have a number of XML files that are used for configuration. At the minute we are thinking of using a script to convert our XML to PHP arrays but that sounds rubbish to me. Is there any way I can encode XML?
[13:34]<dsv>"encode"?
[13:34]<dsv>what's the -point- of storing data in XML if no one but your software should be able to read it?
[13:34]<vxndjvns>because we need to read and change it mst
[13:35]<vxndjvns>but our customers shouldn't
[13:35]<dsv>well, disregarding my personal feelings towards such an idea, you have pretty much everything available to you, including mcrypt
[13:36]<ppupppns>hi, im using file_get_contents() to read a large file (300MB) into a string. but i only want the last 64KB of the file. i used offset with filesize - 65000, but i still get memory usage > 64MB errors
[13:36]<ppupppns>what am i doing wrong?
[13:36]<dsv>use fopen/fseek/fread
[13:37]<2nzuya>How do I check a string for whitespaces?
[13:37]<ppupppns>mst: but isnt offset meant to skip x-bytes ?
[13:37]<ppupppns>why does php still tries to read the whole file?
[13:37]<vxndjvns>mst: I'm not keen on it either but I'm new to the job :) , I'll check out mcryt though. Thanks
[13:37]<2nzuya>I need to make sure that my string doesn't contain spaces...
[13:37]<ppupppns>beruic: use str_replace
[13:38]<ppupppns>$string = str_replace(' ','',$string);
[13:38]<dsv>fluffles: because it's file_get_contents, the whole point and performance benefit of which is to read the whole file, buffered
[13:38]<ppupppns>mst: so why is the offset there? :(
[13:38]<ppupppns>*spanks php*
[13:38]<ppupppns>anyway, ill try the other functions
[13:38]<2nzuya>fluffles: I need to have a TRUE or FALSE returned...
[13:39]<vxndjvns>beruic: use a regular expression
[13:40]<vxndjvns>p_reg_match or something
[13:40]<ppupppns>beruic: use strpos ?
[13:40]<2nzuya>themoves: Isn't there a way the uses less lines? and I'm not good with those yet...
[13:40]<ppupppns>will return false or an integer, if integer you need to convert to boolean true
[13:41]<dsv>beruic: return preg_match('/ /', $string);
[13:41]<dsv>how much less than that do you really need
[13:41]<2nzuya>fluffles: I'll take a look at it ...
[13:41]<vxndjvns>less lines? er, if(p_reg_match('/ /', $string)){, beruic one line!
[13:41]<2nzuya>mst: if(my test)
[13:41]<ppupppns>mst: regexps arent for everyone.. :(
[13:41]<dsv>if (preg_match('/ /', $string))
[13:42]<ppupppns>personally i hate regexps, but i love their strength :)
[13:42]<2nzuya>Thx guys :)
[13:42]<dsv>regexps are the duct tape of the internet
[13:42]<2nzuya>I feel the same way fluf :)
[13:42]<vxndjvns>beruic: they are easy!! Read a few tutorials and you'll see the power and love them
[13:43]<vxndjvns>They don't need to look like line noise to be useful
[13:43]<2nzuya>themoves: Time my friend... So esseintial. Maybe next month :-P
[13:44]<vxndjvns>beruic: indeed. Good luck
[13:45]<rffrg>hm
[13:45]<rffrg>I've never done regexps
[13:46]<swyegrvyw>hello everyone in the awesome php channel
[13:46]<wdsvnz>Dont worry, workd out my problem
[13:46]<swyegrvyw>is there any way I can set a variable in a script when I call it from the command line?
[13:46]<wdsvnz> $filename = "subdir/" . $path_parts["basename"] . ".txt" ;
[13:47]<2nzuya>Think I go for the regexp, then I can chack for other characters too :)
[13:48]<2nzuya>Then I should use if(p_reg_match('/[!"#¤%&/()=?¡@£$½¥{[]}±|+]/', $string)), right?
[13:49]<wdsvnz>Did u still include your space in there?
[13:49]<wdsvnz>I thought thats what you were looking for in the first place :/
[13:51]<2nzuya>You are right. Stupid me :)
[13:52]<2nzuya>Can anyone see any mistakes?: if(p_reg_match('/[ !"#¤%&/()=?¡@£$½¥{[]}±|+]/', $string))
[13:52]<dsv>p_reg_match() is not a real function?
[13:52]<vxndjvns>shiznatix: argv
[13:53]<2nzuya>it's should be preg_match :)
[13:53]<2nzuya>Now then: if(preg_match('/[ !"#¤%&/()=?¡@£$½¥{[]}±|+]/', $string))
[13:54]<dsv>quote the [s
[13:54]<2nzuya>?
[13:54]<dsv>you can't have [ asasdsd[asdasd]adasd]
[13:54]<2nzuya>Show me...
[13:54]<cfjccwnrx[r]>\[\]
[13:55]<2nzuya>Ah...
[13:55]<2nzuya>Shouldn't a space be \s too?
[13:56]<2nzuya>So it's: if(preg_match('/[\s!"#¤%&/()=?¡@£$½¥{\[\]}±|+]/', $string)) or what?
[14:00]<dzvvxgwrzzgg>hello room i have been building a blog from scratch www.hertfordtown.info/blog.php
[14:00]<dzvvxgwrzzgg>can any one help me work out how to put pictures in the entries
[14:00]<dzvvxgwrzzgg>i know i need a folder on my server for the image
[14:00]<dzvvxgwrzzgg>and a field in the db to record the url to the file
[14:00]<dzvvxgwrzzgg>but havent got a clue how to code it really
[14:01]<ran_dn>I have a file name stored in a blob field as : ../../images/ddc/file.txt ! aslo this file is existing on a folder under /images. When I delete it I receive some error ! I get the file name from table by : $file = addslashes($row["DOC_FILENAME"]); and than I try to unlink with : if (unlink("\"".$file)."\"") but I receive an error even if the file is deleted ! anyone know why ?
[14:02]<rymrg>ace_me: here's an idea, tell us the error message?
[14:02]<rymrg>ace_me: I find it hard to believe that wasn't obvious
[14:02]<2nzuya>What's wrong?: if(preg_match('/[\s!"#¤%&/()=?¡@£$½¥{\[\]}±|+]/', $string))
[14:02]<ran_dn>[function.unlink]: No such file or directory in D:\X_Site\project02\prog\admin\uploaddocumentation.php on line 39
[14:02]<ran_dn>[function.unlink]: No such file or directory in D:\X_Site\project02\prog\admin\uploaddocumentation.php on line 39
[14:02]<rymrg>ace_me: ... okay so the file you're trying to unlink doesn't exist, that's pretty self explanatory too







