@# 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 23 24 25 26 27 28 29 30 31 32 33 34 35



Comments:

<0> endemic: regex?
<1> can someone point me toward a method of using __get and __set for 90% of object variables, but allowing me to override for specific cases when I want to format the variable value before returning it via get and such?
<2> deadroot: yeah, I figured it would come down to that. My mortal enemy :) Actually they are extremely useful I just **** at them
<1> right now I have a custom getSomething setSomething for every variable, but only really need custom methods for a few cases
<3> 110115600005145281001010001000
<3> i get this deadroot
<3> foreach ($array as $value){
<3> echo $value;
<3> how can i like check in the $array the letter index
<3> if $array['a'] ?
<3> like that
<0> sharmaa: i don't like babysitting you every step of the way. :(
<3> please this is the last thing
<3> then i will stop
<3> thank you for your help
<3> very appreciated



<4> !tell sharmaa about enter
<0> sharmaa: www.php.net/foreach
<5> Hi, i want to have a box on my page which shows the latest news headlines from another website.. Whats the best way of doing this? use a function to get the html file from that other website and then parse it and use regular expressions to get the latest headline?
<5> maybe read the source of the html file of the other website into an variable which i use for the parsing?
<0> gimmulf: if your source has RSS/Atom feed, you could you that
<0> *could use that
<5> it hasnt :<
<0> then parsing is the only way
<5> oki thanks
<0> be sure to cache the results
<3> foreach ($array as $key => $value){
<3> echo "Key: $key; Value: $value<br />\n";
<3> i did this deadroot
<3> but thing is i want to check
<3> i.e. if $key value is greater than 0
<3> then make a label with that $key
<4> !tell sharmaa about enter
<4> again
<3> hi deadroot
<3> could you show me how to do that?
<5> deadroot: isnt there a better way then $file_to_parse = file('http://www.theotherwebsite/index.asp'); just want to parse the text but reading that into the variable takes alots of time seems like it loads the website or something
<3> hello deadroot
<6> hello, how could i get php to p*** POST variables to another php script? i want a cron job to send vars to a forum's 'post-reply' script
<5> seems like it tries to load all the images and stuff into the variable
<3> foreach ($array as $key => $value){
<3> echo "Key: $key; Value: $value<br />\n"
<4> gimmulf: it does. it loads the entire output content from the web server into the variable.
<3> i did this but i want that if $key his value is greater than 0 print the key
<5> b1n0ry: isnt there a way to just load the source?
<5> the source code
<4> gimmulf: but, then again, you are sending an HTTP request to the site. what would you expect it to return? it doesn't know the difference between your script and a web browser.
<3> could someone show me how to make an if statement
<5> true :)
<3> with $key => $value
<3> of an array
<5> so is there a better way? :)
<4> gimmulf: you got it
<3> to check that $key's value is greater than 0
<4> gimmulf: in order to get another web server to return content, you must send an http request for the content. however when you send an http request you must expect the web server to respond as it would to any other http request.
<5> mmm true :/
<3> hello
<4> hello
<3> hi bin0ry can you show me how to make an if statement with a foreach($key, $value)
<3> foreach ($array as $key => $value){
<4> sharmaa: what would you want to do?
<3> if $key => value is greater than 0
<3> make a radio button with label $key
<3> foreach ($array as $key => $value){
<3> echo "Key: $key; Value: $value<br />\n";
<4> sharmaa: please type in complete sentences without pressing enter in the middle. formulate your thoughts, put them together, then press enter.
<7> instead of mysql_fetch_***oc, or mysql_fetch_array how can i get the row and col numbers of a table?
<3> how can i make an if statement of $key of the $array to see if it has a $value greater than 0
<4> shale: no idea how many rows mysql returns until you move the pointer through them
<4> sharmaa: let me think about that for a second
<7> b1n0ry how can i move the pointer through them?
<4> shale: using mysql_fetch_row or mysql_fetch_array in a while loop
<7> ok thanks
<4> sharmaa: one sec, i'm refamiliarizing myself with the referenced foreach statements
<7> is there a way to do it in a for loop?
<8> b1n0ry: shale: using mysql_fetch_row or mysql_fetch_array in a while loop
<4> shale: not really. for would imply that you know how many iterations you need.



<3> no shale
<8> lol
<4> jiggster: what's so funny?
<4> oh... duh
<4> shale: you could use mysql_num_rows()
<8> i'm always glad to pop in and paste a completely random snippet when i think it fits :P
<4> boy do i overly complicate things or wtf?
<3> hi bin0ry
<3> do you know how to do that
<4> sharmaa: almost got it
<4> i'm reading some documentation now
<7> b1n0ry what about using mysql_num_rows?
<7> doesn't that return the number of rows
<4> yes
<9> Good Night (For real this time) <3 You all. Spread the love through out the world please.
<4> sharmaa: i think i got what you need (i hope) i'll pastebin it
<10> lets so you have a string like
<10> abc def
<10> better yet, 123 456
<10> if i watned to add 123 to 456 i would need to explode the string by the " " delimeter
<4> sharmaa: is this what you're trying to do? http://pastebin.com/571358
<4> Artnez_ that would make sense
<10> which would require 2 or 3 lines.. anyone have any thoughts on how to do it in on 1 line?
<10> (stupid example follows)
<10> $test = ( $test[0] + $test[1] ) = $test = explode( " ", "123 456" );
<10> which of course errors out
<4> Artnez_ wouldn't 2 lines be more readable and friendly?
<10> yes :) i'm just experimenting
<4> Artnez_ that's a lot to go through just to save one line of code
<10> this is what i do on friday nights
<10> :-/
<4> lol, let me think about this... perhaps there is a way to do it
<3> hm
<3> i want to say if($value > 0)
<8> i should go to the bar in a while
<3> echo $key
<3> i.e. make a radio button with the label of $key
<11> hey guys, i was ***uming if i had a combo box in a form, that it would give me an array of all the checked values in $_POST. this doesn't seem to be the case however (it seems the last one just overrides them all), how does one handle checkboxes appropriately in php?
<4> sharmaa: then echo the key. i just put in ...do something... so you can do what you want to do in there
<3> does the $value relate to the specific $key
<3> in that instance
<10> cmatheson: just check if it exists
<10> for example, <input type="checkbox" name="mybox">
<10> if ( isset( $_POST['mybox'] ) ) echo "it is set"
<4> ssharma: so you'll do echo "<input type='radio' name='$key' /> $key<br />";
<10> also, if you set the value parameter for the checkbox, you can give it a val
<4> sharmaa or something like that
<8> my external hd is making funny noises...
<10> however if you have a list of checkboxes you can have something like <input type="checkbox" name="list[]">
<8> it's my backup drive...
<10> $_POST['list'] would then be an array of values
<8> if it goes, i swear to god i'm retiring
<3> hm
<10> for all of the checkboxes
<11> Artnez_: oooh, so i need to specify that it is an array in the name?
<3> how could i make it though
<3> so its in line
<3> i.e i have a b c d e f g h
<10> not necessarily, if it's a list of checkboxes that is preferred
<3> i j k l m n o p
<11> Artnez_: great, i'll give that a try, thanks
<10> aye
<3> i.e. i want bin0ry you still here?
<4> Artnez_: heh, now you've made me busy
<3> if $value > 0 make a radio button
<10> its intriguing
<3> else make a label without the radio button
<2> is there a very simple way to just county how many elements are in an array?
<4> sharmaa: so then add an else clause.
<3> and it should be alligned in rows not like one per line
<4> endemic count()
<12> endemic: count()?
<2> b1n0ry: I'm trying that but I must have my syntax messed up for that function


Name:

Comments:

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






Return to #php
or
Go to some related logs:

#web
#perl
lkl keymap memory
Freenode Spum
#javascript
#oe
(NS_ERROR_FAILURE) [nsIXMLHttpRequest.setRequestHeader]
pport.h
Dreambox cron job
What is GSI? ACPI



Home  |  disclaimer  |  contact  |  submit quotes