@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22



Comments:

<0> what if the array actually is non-numerical or there is different key names?
<0> jessta ill make ione for you
<1> I answered the question.
<1> If I wanted to get technical, down and dirty, I'd use iterators.
<1> foreach ($foo as $v) { echo $foo, "\n", next($bar); }
<1> Are you happy now?
<0> $one_keys=array_keys($array_one); $two_keys=array_keys($array_two); foreach($one_keys as $i => $key_one) { $key_two=$two_keys[$i]; $value_one=$array_one[$key_one]; $value_two=$array_two[$key_two]; }
<0> :)
<0> could be improved
<1> ...
<1> You question my code? I question your logic.
<1> s/echo \$foo/$v/
<0> <2> can anyone tell me if I can use foreach() to iterate through two arrays at the same time?
<0> it didnt say echo
<0> anyway.. bye
<1> It's still iterating.



<2> thanks guys
<1> Question me, but question yourself first.
<1> Rule of thumb, kuja is 90% of the time right.
<0> :D
<0> i agree
<0> but not this time
<1> Yes, this time as well.
<0> my way of doing things can be applied even for an ***ociative array
<0> and yours cant
<1> foreach ($foo as $value) { echo $value, "\n", next($bar); } // Sure it can
<0> what if you have an array $foo=array("name"=>"foo","surname"=>"bar"); and $bar=array("bzz"=>"bzxx","oop"=>"s"); ?
<1> wykis_: next() and key() accordingly.
<0> jessta didnt say that keys are the same
<0> anyway bye
<0> bathing
<1> ...
<1> You're stupid.
<1> php.net/key please.
<0> oh ok
<0> but if i went your way, still the second array_keys would be required
<1> GOOD ****ING LORD
<0> the first one wouldnt
<1> READ THE ****ING MANUAL WILL YOU?
<0> i AM!
<1> Do you know what a ****ing iterator is?
<0> Yes..
<0> err
<0> nvm
<0> :P
<1> wykis_: $foo = array('foo' => 'bar', 'baz' => 'qux'); next($foo); echo key($foo);
<1> What does this code output?
<1> Or I could point them to a manual page, and tell them to read the entire page, but no, that'd be stupid, because of course, reading the manual is for retards!
<1> </sarcasm>
<3> are there tertiary operators in php? can I do eg. $name = $_POST['name'] ? $_POST['name'] : false;
<1> sander_: Ternary, yes.
<3> kuja thanks for the answer, and the spelling :D
<4> I'd use isset($_POST['name']) because your first line will generate a warning if $_POST['name'] doesn't exist
<5> javascript:document.login.submit()
<5> why this doesnt work from within php scripts?
<6> um
<6> Char0n: Because JS and PHP have nothing in common?
<5> it says:
<5> 'document.login' is null or not object
<6> I found this very suspicious... Pastebin your code, please
<7> how can i enable gzip on a page? and is it easy to do?
<6> Viper007Bond: Just enable mod_gzip and php's gzip extension
<7> well, gzip is available (i think) as it's being used on some other pages generated by a script
<7> and how can i check to see if a page is being gzipped?
<8> make sure you have ... id="login" in the form tag Char0n
<9> can i repeat a string n times without a loop? like with 'x' operator in Perl
<8> str_repeat() :)
<9> trep-: thanks :)
<8> welcome
<5> trep- !!!
<5> thanx !!!
<5> works
<8> np
<5> c ya guys !
<10> hi.



<8> hi
<11> hi
<10> is it possible to get the third element from right to left in a string ?
<10> string -> could I add a . (dot) between srt and ing? like str.ing?
<12> hi guys
<10> hi there.
<8> Arthur__, sure
<10> how could it be, trep?
<8> look up the substr function
<8> given a string, you can ask for X amount of chars starting at position Y
<12> how can i send a form variable to a popup window
<8> so, for your specific question I think it would be something like:
<8> $character = substr('str.ing', -3, 1)
<8> -3 (go to the 3rd last character, only retrieve 1 charcter)
<8> will need to double check, but something like that
<8> Skretch, what do you mean?
<10> did you get I want to ADD the dot (.) at that point?
<12> you have a play button on a page
<10> substr isn't for subtracting string?
<12> when you click it a popup comes
<8> ah sorry - substr will get the value
<12> but i have to bring the value from the button to the popup
<8> well, to add the dot there - splice the string up into two parts, put the dot inbetween
<8> so... $string = 'string';
<13> how can I convert a '0000002' string into 2 integer ?
<8> $final = substr($string, 0, -3) . "." . substr($string, -3)
<8> thats probably not going to work, but something like that
<14> omercnet, (int)$string
<8> just split the string up and join it between the period
<13> thanks
<8> Skretch, not sure - perhaps via javascript
<12> i did it like
<8> or make the popup window open the page with the variable you need in the url... popup.php?variable=value
<12> trep- thank you mate
<12> i was thinking on the same thing
<12> but i was unsure is it possible
<8> of course, why wouldnt it be?
<15> hrm, does PHP4 have interface and abstract cl***es?
<15> I can't seem to find the answer
<8> dont think so
<12> trep- i have to change my php code perhaps
<8> dont quote me on it
<10> thank you, trep.
<12> the variable should be like
<8> maybe look at the php5 release notes Seadog, check if its mentioned as being introduced there
<12> $_POST['variable']
<12> right
<15> trep-, ah, didn't think of that :D
<15> trep-, I would use PHP5 but the host I'm working on seem to think it hasn't been released :P
<8> Skretch, nah, POST is post data - variables on the url are 'get' data
<15> and nothing will convince them otherwise
<8> what about this page? http://www.php.net/ChangeLog-5.php
<8> :)
<15> :D
<8> http://php.mirrors.ilisys.com.au/manual/en/language.oop5.abstract.php
<8> abstract introduced in php5 yer
<12> trep- so it should be like $_GET ?
<15> ok interfaces are a nono
<15> This won't work with cl***es who are using PHP 5 features such as interfaces.
<8> probably the same with interfaces
<15> trep-, ah ok then
<15> got neither XD
<8> http://au3.php.net/manual/en/language.variables.external.php read that page Skretch
<12> trep- thank you mate
<15> ugh, how do people expect me to code nicely with OOness if they don't have PHP5 >_> :P
<8> change hosts dude if they blow
<8> np Skretch
<8> (yes, its _GET)
<15> trep-, yeah, but they bought a 6 month deal lol
<15> not their best idea
<8> php4 OOP (or lack of) is a lot different in php5, so be sure to stick with one
<8> php5 is far better for oop
<15> yeah
<8> if they are playing the ignorant card, show them the link to php5, and question why they are in the hosting business if they dont realise


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

#css
/proc/core linux
#perl
#osdev
#debian
#mysql
pentium4 mmx2
howto disable aiglx gentoo ati
#suse
virtual/jdk sun-jdk



Home  |  disclaimer  |  contact  |  submit quotes