| |
| |
| |
|
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 34
Comments:
<0> print letter for letter in range('a', 'z') <1> i know! it's hard being a hybrid in a hurry <1> erm that's invalid python... <0> cb921: Might be, I might have the crap wrong. I know -- for letter in range('a', 'z'): print letter # ain't wrong <0> cb921: Nevermind, I got range() all wrong too. :) <1> :) <0> cb921: Was thinking in terms of [foo for foo in bar] <1> which php lacks :( <0> Meh, doesn't really need it, but it's nice to have. <1> don't need ++, but it's nice to have too :) <0> Well, what can ya say, PHP is too C/Java-like :) <2> php lacks? <1> a list comprehension like python's <2> so... phyton is like php <0> No
<3> Erm...no :) <4> kuja: thx a lot <4> the range function is new to me <0> nk_: np <0> Apparently PHP's range differs from Python's, meh. <3> range functions...pff! 1..6 ;) <0> :) <1> the One Language cometh <0> (1..2).kind_of? Range # Yummy. <0> Apparently ranges were a big enough highlight that they needed their own cl***. <3> (1..6).to_a.join(', ') #=> "1, 2, 3, 4, 5, 6" <3 <5> hi <0> Frixon: Ranges are not much useful without arrays though.. it would have been nicer if a Range was just syntactical sugar for arrays. <5> i'm looking for a function that do an echo of all the elements of an array recursively <0> alainlucas: print_r($array) <2> alainlucas, print_r <5> kuja: i mean a function(){} <5> kuja: using foreach <0> alainlucas: Make your own recursive function. <3> alainlucas: Erm...so write it yourself? <2> why you need to re-invent? meanwhile you already have? <3> alainlucas: foreach/is_array/echo <5> because i can't do anything else than echo with print_r (isn't it) <0> Ox41464b: Maybe because print_r()'s output is not the output he wants. <2> wrong <2> print_r($array, bool) <2> bool here is for return or echo <2> php.net/print_r <0> Hm... Python listcomps are actually not very different from some Ruby blocks. Wonder why I didn't kind of realize this earlier. <6> crap... <6> what did i code utterly wrong here? <6> http://talk.pastebin.com/576407 <0> jlulian38: Line 10. <6> yes? <0> Look at it. <6> the start of the while loop right? <0> The condition of the while loop. <6> ya <0> jlulian38: Maybe, if you boost your error reporting to show notices, you'll see that line 10 is faulty. <0> 11, 12, 13, 14, 20, 21 are also wrong. <6> crap <6> oops <6> i'm still used to C and Lua... <7> hi all, anyone know how i can automatically send a user to another page depending on how db query works or not? <0> shikamaru85: php.net/header <7> kuja: tks! <8> i am trying to trim url's <9> Hello <8> hello <9> how can i get array key name without using foreach <3> foreach($ary as $key => $val) <3> Oh, without. <6> sorry that i'm going to be really noobish right now, but i still don't see what's from with this... <6> http://talk.pastebin.com/576421 <3> sahithya: http://us3.php.net/array_search <9> thanks <10> hey all:) just working on something here and ive run into a slight problem - prob something simple for you all, heh. been looking through the php manual for a while now, but can't figure out why my array hold two of the same value instead of two diff values when i query for id's <3> sahithya: Or if you want all keys: http://us3.php.net/array_keys <5> Ox41464b: i need to rewrite it because i need to echo it my own way <10> something to look at: http://pastebin.com/576426 <5> Ox41464b: and get some stats from it
<0> jlulian38: Line 10 and 20. What is so hard? <6> Also <6> i happen to be very new to this language <6> And i don't see what's wrong with line 20 <6> it follows the syntax correctly <0> jlulian38: Incrementing a constant does't make sense. <0> i++ // increment the constant 'i' <6> it's a constant... <6> how'd that happen? <0> It's not a variable. <0> jlulian38: The moment you decided not to use $i <6> sorry <0> Now, let me ask again, what is so hard? <6> my brain stopped <6> stuck between lua and php <6> not adjusted yet <10> sorry to jump in:) anyone have a moment to take a look at http://pastebin.com/576426 ? <6> i kinda ate up kuja... <11> aneurysm: What's the question? <10> TML: well simply put -i want the diff id's for the rows that contain '4' in column 'type' <10> i want them in an array <11> aneurysm: So put them in an array instead of echoing them <10> i'm echoing to make sure i am grabbing what i need - i'm not though - it grabs the correct number (of times), but the same value for each input in the array <10> i want array(2,5) and it gives me array(2,2) <9> Frixon i got it <10> and when there is only one instance of a row with value type=4 - it returns array(1) <-- where id=1 is row with type=4 <9> Frixon now how to remove perticular value from the array, it is in the middle <9> i donot know its key value <3> sahithya: unsetz() <3> sahithya: You know the value? <0> sahithya: if ($key = array_search(...)) unset($array[$key]); // fill in the blanks. <3> unset($ary[array_search($value)](; <9> i know the value <0> Frixon: Not fail-safe, but that works, kind of. <11> aneurysm: Maybe it's returning the same value everytime because you're using $i inside the loop, but the loop variable is $j <7> kuja, Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. <3> kuja: Sure thing. I wouldn't write that in a production environment. But people can think for themselves a little bit, too :) <7> kuja: what do they mean by blank lines? <12> G'morning TML <0> shikamaru85: Not output must be sent before header(). You do know what "output" is, don't you? <10> TML: you know what? i found that right as you typed it <11> shikamaru85: Well, which part of "blank lines" do you not understand? <10> TML: thanks:) <7> kuja: i get an error saying <?php is sending output <11> shikamaru85: Do you have *anything* before "<?php"? <12> shikamaru85, are you using includes? <11> shikamaru85: Including whitespace? <3> shikamaru85: You can't have output befor sending a header() <12> shikamaru85, as in your site is sent into index.php through an include? <7> do comments count? <12> shikamaru85, if they are commented. <12> :P <0> shikamaru85: Yes, if they are not PHP comments. <12> !tell shikamaru85 about headers <7> tks <12> kuja, lol, I found myself into huge problems with headers..since my pages are getting included to my index.php <13> Hi, is there a way to force the reload of a page I ***ume using the header function but "Expires" doesn't do what I want any suggestions? <0> Heh... <14> kuja: er... where else would you send headers? <0> err <0> Output before headers :) <15> kuja: that seems like an intentionally inflamitory statement <0> mazza[W]: Back into the microwave for you! With me! <15> :P <16> kuja: :B <6> is there something wrong with the way i'm calling mysql_result here? <0> I miss my girlfriend... when is she coming home :( <6> $user = mysql_result($result, $i, "talk_chatter.chatter_username"); <16> kuja: guess when you send the headers.. <12> kuja, well includes mattered on mine..since the layout is HTML and there are <? include 'suchandsuchapage.php'; ?>
Return to
#php or Go to some related
logs:
needs unknown symbol _spin_unlock_irq widget_grab_focus behavior #fluxbox xmkmf gentoo nvidia emerge newroot access denied sqlite no wildcard #debian Can't access procfs/sysfs file amd64 no-multilib gentoo grub-static brasnet kopete
|
|