| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
Comments:
<0> unfortunately the rest of world does <1> well some behaviour has to change, for example colorZilla doesn't work on my OS as nice as it does with windows <1> spiggy: if it is a browser issue it probably would be best seeked in #web or #html <2> Elliot`, I did. I also did ob_end_flush(). But I save it and then try to open it with Gimp and it's apparently corrupted. <1> builder: open it with vi or a simple text editor <0> zircu: nah. i dont think this will be helped by some nifty CSS :) <1> spiggy: well, it surely can't be helped with php <2> zircu, I see what it did. It didn't submit the request as a post. So I got some plain html back. DUh! <3> meh <3> stupid script not working properly under php5 :P <4> thats php ^^ <3> did something change with stdin in php5? <5> kyelewis: yea, there's a cover fee now. ;) <3> heh <3> trying to figure out why this script is running right through <3> right through like 10 fgets()
<3> :P <3> ahh, that's better <3> i had 2 lines that both opened php://stdin to $stdin <3> guess php5 doesn't like that <5> tsk tsk <5> :) <1> you opened stdin twice? <3> zircu: heh, so my code says <3> "but, but, but, php4 didn't mind" "quiet you" <3> :P <5> for fun *and* profit <5> one for each. ;) <1> just use the constant STDIN to ***ign the resource.. $fp = STDIN; while(! feof($fp)) { ...} <6> is there any way to check the filesize of a URL? ( I'm trying to limit the filesizes of .jpg forum avatars that users link to on a form) <7> how can i run a system command from php using exec via sudo? <8> why would you want to do that... sounds like a huge security hole <9> lig 'stupid is as stupid does' <8> hey Jymmm darlin' <9> lig =) <10> hi..someone here? <10> I am not very good in reGExp... I have a string like dee = blbabla| asd - qwe | asdasd = sad ... <10> how can I get blabla or sad or qwe out of it? <8> explode on the pipe then the =... <10> lig: it was for me? <8> yeah - just an idea <10> not it is not a very good idea <11> lo <10> blkhawk[work]: are you free for a minute please? <10> I am not very good in reGExp... I have a string like dee = blbabla| asd - qwe | asdasd = sad ... how can I get blabla or sad or qwe out of it? <8> macronyx: you can do a series of explodes on the string to get what you want... it will work and take less time then a complex regex <4> use exploed aslong blabla etc. don't contains | - oder = <8> anyway I'm out <8> later Jymmm <11> macronyx: well ya <11> hmmm <11> macronyx: seems your strings are delimetered by spaces <11> simply match for <11> " .* " <11> you need the - and the =? <10> not..they are in form like "variable = value |" <10> I need the value <11> easy <10> so? <11> sorry /me points at [work] <12> it seems blkhawk[work] is doing lots of stuff which isnt exactly work <10> preg_match('variable*=**|', $string) <10> ? <11> macronyx: yes <11> uhm <11> no <11> any chat is . <11> char <11> not * <10> aha <10> preg_match('variable.=.|.', $string) ? <11> well <10> there's no space for the value... <11> 'variable *= *(.*)|' <10> tnx!! I'll try <11> I use python most of the time tho <11> the () will make the string availible as a group
<11> anyway - I am looking for a database interface builder - kinda like a CMS for a CMS <13> you know, as a testament to how stupid I am, everyone says python is so human readable ... al the python I have ever seen ... I was like uhhhhh <14> blkhawk[work]: Sounds like the sort of thing you'd get from the Redundant Department of Redunancy Department <15> macronyx: preg_match_all('!\s*\w+\s*\=\s*(\w+)\s*\|?!', $str, $matches); <14> slid3r: When they say "human readable", they mean "It doesn't use a lot of special symbols" <15> macronyx: then $matches[1] will contain an array with all the values you want <14> slid3r: For some reason, some "humans" have trouble reading things with lots of $, %, @, {, }.... <10> niraj: $matches[1] is "Array" though... <14> macronyx: Actually, it's probably an array. <15> macronyx: i know.. try print_r($matches[1]) :) <11> TML: I need it to build an interface to a legacy website <14> blkhawk[work]: I've never even heard of anything such as that. <14> A CMS for a CMS? <11> changing everything with phpmyadmin ****s <15> macronyx: $matches[1][0] will contain the first match, $matches[1][1] the second match and so on.. <13> now, not to be argumentative but ... http://pastebin.com/542891 this script was invaluable to me and I still look at it and have no idea how to expand upon it <10> niraj: yes. how can I get just one variable out of it? otherwise I don't know which match belogs to which variable... <14> macronyx: He just showed you. < niraj> macronyx: $matches[1][0] will contain the first match, $matches[1][1] the second match and so on.. <11> TML: basically a php script that will allow me to quickly reference a database table in a custom way <11> TML: generating html code <10> TML: but the order of the variables can be different in the strings :( <14> slid3r: That's not significantly different from PHP. What do you find "unreadable" there? <11> TML: defining i want x,y and z from table a in DB d <11> generating html forms that match the database data typs <13> well first of all, the 'implied' asci reference <14> blkhawk[work]: Not something that's readily available right now. You'd pretty much have to roll your own. <14> slid3r: The which? <11> TML :awwww <15> macronyx: i'm not quite sure what you mean.. but would another array containing the variable name in the same order as the values be helpful? <13> ranges = range(97, 122) <13> ranges.extend(range(48, 57)) <11> TML: it should be useful tho <10> something like preg_match('!\s\w+ variable \s*\=\s*(\w+)\s*\|?!', $string, $matches); <14> slid3r: PHP has the same constructs. What's hard to understand about it? <13> those are the ascii references to certain chars <14> $ranges = range(97,122); <13> you know what TML, why be combative? <14> slid3r: Who's being combative? <13> all I am saying is that I am ignorant <15> macronyx: not quite sure what you mean.. <13> and have a hard time reading code in python <10> niraj: I have a string in fotm "varA = valA | varB = valB | var C = valC" and I need valA out of it <16> How can I return and receive an array from a function? <14> slid3r: And all I'm saying is that if you have a hard time reading that python, I imagine you'd have just as much (or nearly as much) difficulty reading the same code written in PHP, given that there'd be very little variance. <17> slid3r: Haha. At least you're honest. <14> BadBreath: function foo() { return array(1,2,3); } $bar = foo(); <15> macronyx: only valA? not valB, and valC? <10> niraj: yes <14> macronyx: So you want the first value that appears after an equals sign in the input string? <10> niraj: or only valB .etc... <15> macronyx: change preg_match_all to preg_match <16> TML and slid3r: php is much easier for me... because the syntax is pretty standard as to other programming languages and python absolutely is not.. that's what keeps me away from python.. I just cannot get used to its weird syntax and terms like, "dictionaries" <10> I need a value from a given varX <10> not just the first one <16> TML: but I tried that and then printing the elements of the array gave me only the array name. <14> BadBreath: The only major difference on the surface is that Python uses whitespace to delimit instead of ;'s <14> BadBreath: What do you mean it "gave [you] the array name"? <18> Hi, i need a little hand say i have $dd $mm $yy i want to work out how old someone is from those values <15> macronyx: ahh.. use preg_match_all('!\s*(\w+)\s*\=\s*(\w+)\s*\|?!', $str, $matches); <14> dimitri1: php.net/date <16> TML: I mean that, in the function, I created an array "ar = array();", populated it and returned it. When I printed the elements of what was returned from calling the function, it gave me merely "a r" <15> macronyx: now $matches[0] contains a list of variables, and $matches[1] contains a list of values <15> macronyx: oops i mean $matches[1] and $matches[2] <14> BadBreath: Pastebin the code you used. <10> niraj: tnx, I'll try <18> tml <18> how would i enter that format in. <15> macronyx: then you'd have to go through $matches[1] to find the variable you're looking for, and then get the key for it, anduse the same key on $matches[2] to get the value for that variable <13> well TML, I think I can read php pretty well, I am not a pimp at it or anything <13> but I can definately read it better than python <14> slid3r: I propose that it's all in your head. You find Python hard to read because you expect it to be hard to read. <14> dimitri1: You have to use mktime() to convert your dates to seconds, then use math to convert that into days, weeks, months, years, etc. <13> TML: thats prolly true <13> I dunno
Return to
#php or Go to some related
logs:
gentoo compiling 32bit applications #centos hrm,environtment #mysql ubuntu java cannot set locale #kde partition id 27 #dns lan1 deutsche fc5 installing alsaconf
|
|