@# 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



Comments:

<0> Bery: that is because you chmod them +x and then do ./script_name, i am doing php <script_name> so i don't need the entry
<0> Bery: ok
<1> can I create an ***ociative array in one go? like $myArray = array( 'key'=>'value', 'key2'=>'value2' )
<2> Woosta: yea, you can =)
<1> just like that??
<2> well, add a ; on the end
<1> heh, what a guess :)
<1> thanks :)
<2> np =)
<1> do the keys need quoting?
<2> atleast a single quote yes, also, check out --> http://us3.php.net/manual/en/ref.array.php
<1> cool .. thanks
<2> if you are going to have the values replaced with variables, be sure and double quote them, as I don't think single quotes will work..
<0> hey thanx guys, i did not have apache-mod_auth_mysql installed
<0> installed that and it's showing up now
<2> cool =)



<1> OK, another annoying question .. this time I looked .. how do I get the server's hostname? I don't want to call `hostname` as this might be run on windows ..
<3> Take a look at the $_SERVER array, with that sort of information.
<1> ahh thanks
<3> You want HTTP_HOST.
<4> Hi
<5> Is there a simple way to compare a variable for many values? Such as; I want to know if $id is either 5, 7 or 983, can it be done in some cute way, or do I need three if's or a switch/case block?
<6> the array of compared values, is it in an array? There are some array comparison functions, and str_comp or whatever it is takes arrays, i think
<5> I would also like to avoid if ($id == 5 || $id == 7 || $id == 983)
<1> quantum superpositions would help .. but I doubt they're implemented in PHP :)
<5> Nope, not array.
<4> maybe you can put the possible values in an array and use in_array function
<6> Laban, a switch might be easier to read
<5> Ah... Clever.
<7> switch!
<6> www.php.net/switch
<7> damn you Bery
<7> damn you!
<6> rusty, shush you
<5> :)
<5> Oh boys, no need to fight over _ME_ ;)
<7> its not you, its the beautiful and single switch!
<6> Laban, we're geeks. We're fighting over the code.
<1> I've got something wrong with my ***ociative arrays .. this is giving me a syntax error at the '(' after 'date': $myArray = array( 'creation_date' => date('Y-m-d') . "T" . date('H:i:s')."+10:00" );
<7> oh how i adore her
<6> *snicker* and we're STILL on the same wavelength. weird.
<8> hi everyone, has anyone sent binary data over xml-rpc?
<5> Bery: Of course you are. Give 10 programmers the same task to do and you'll get 10 different solutions.
<4> use "Y-m-d"
<8> how would you read that in and save it as a file?
<1> really? Why would that fix it?
<9> What's the best way to go about doing this logically... I have a permission variable that can be either "Public" or "Members" how would I write it so if it's "Members" it shows both "Public" and "Members"
<9> I know it's a simple answer, but I'm horrible with logic. ==(
<1> Still get the syntax error: Parse error: syntax error, unexpected '(', expecting ')'
<10> if($thing=="Members") { echo($public); echo($members);
<10> } else { echo($public); } (sorry for the newline
<4> Uhm, no Woosta, yes probably it will not fix it, I overlooked your code
<1> (I should point out that there is newlines around this .. I ***ume php can handle that .. ?)
<11> how do you do divide again?
<1> $myArray = array( <newline> 'creation_date' => ...
<10> marcrosoft: /
<11> oh hehe
<11> :)
<11> thanks
<1> marcrosoft: a meme: division is a fraction .. so make it look like one
<6> okay, time for me to go now, goodnight
<12> Anyone know why I would be getting a blank DOMDocument object after telling it to load a file?
<12> the file is in the directory
<11> how do i round up?
<2> ceil
<10> But division between ints yields int, not float.
<2> ?
<4> Probably the newline Woosta
<1> So you can't have newlines?
<1> gah!
<12> oh nevermind
<4> why do you need a newline there?
<4> what are you trying to do?
<13> you can have newlines there
<4> yes?
<1> There's about 100 key pairs defined in this .. so I have each pair on a new line



<4> maybe "<newline> creation_date", but I dont think you can have a new line before a key
<13> that's perfectly fine
<13> danf_1979: yes you can
<4> Ok, I haven't done it so I take your word for it
<13> danf_1979: if you haven't done it, it's better not to advise about it :-p
<1> tempest1: so what's wrong with my code then?
<4> I said maybe :)
<13> Woosta: I haven't seen it, can you link me?
<1> sure .. 2 secs ..
<1> http://pastebin.com/643227
<1> Parse error: syntax error, unexpected '(', expecting ')' in blah/blah on line 11
<13> k
<13> look at line 13
<13> you ended it with a semicolon not a comma
<1> heh
<1> yup .. so would that be causing an error on line 11?
<1> nup
<13> ok, let me run it then
<13> you can't initalize cl*** members before the constructor
<1> http://au3.php.net/oop <-- was reading that ..
<1> gah ... didn't read it properly
<1> /* None of these will work in PHP 4. */
<1> Sorry for h***ling
<13> no problem, i've asked stupider
<1> So .. is the constructor a function with the same name as the cl***?
<2> Woosta: yes, it is =)
<13> Woosta: yes, unless you're using PHP5 where they've added __construct() and __destruct()
<1> cool .. I'm from perl .. new myCl*** calls the 'new' method :)
<13> destructors aren't present post PHP5
<3> I think you mean pre PHP5.
<13> doh
<1> I figured it was a predition that they'd be removed again :-P
<13> lol
<14> does anyone know of a good site that has a tutorial on looping through xml?
<15> what you need?
<15> what do you mean by "looping through" xml?
<15> and in the end, what do you plan on doing with the data you extract?
<15> XML is a very mallable format, and there's about 3 options for you to choose from based on your needs
<14> well i have a xml file i've created and i need to capture the amount of elements then extract it out into a unordered list
<1> speaking of which .. what is domDocument? I ***ume it's some sort of extension that's publically available?
<1> virogenesis: if you know the format, then from the code I'm looking at domDocument will help you :)
<15> Woosta, it's the specification for a document instance
<14> Dom = document ojbect model
<15> Woosta, maybe not, depends on what he needs
<15> there's ALOT of things you shouldn't use the dom for
<1> yeah .. I know all that .. but it's a cl*** that doesn't seem to be available on my machine here
<1> Fatal error: Cannot instantiate non-existent cl***: domdocument ...
<15> Woosta, that's because you don't have the dom extension
<1> that's what I was asking ..
<1> (10:02:18) Woosta: speaking of which .. what is domDocument? I ***ume it's some sort of extension that's publically available?
<15> DOM
<1> So where do I get it?
<15> www.php.net/dom will tell you
<1> lol .. of course :)
<15> vigilante, you should use xsl for that
<15> a simple xsl:for-each loop would probably work.. hold on!
<15> ENJOY!! http://www.zvon.org/o_html/group_xsl.html
<15> I became a master reading through that entire section
<15> also, www.php.net/xsl is a nice extension to use, www.php.net/xslt if you are php4
<14> http://phpfi.com/111134 <-- thats my xml file
<13> virogenesis: www.php.net/DOM
<15> yeah, I think xsl would be a good call
<15> look at this example of xml transformed by xsl on the client side I did: http://www3.whig.com/rss.php
<13> never used xsl
<15> http://www3.whig.com/rss.xsl is the xsl for it
<14> i'm needing to count the amount of images aswell gonna squirt the gallery name, desc and number of images in a div using ajax :D
<15> oh, and view the source of the php page... some people idiotically just think it is html
<15> and say "So?"
<15> vigilante, you can do that to, using the xsl functions
<15> I would suggest studying that zvon site I liked to, especially the tutorial and the reference guide
<15> I landed my current job at carfax because of my great XSL skills
<15> (although my OO skill aslo paid a huge part)
<14> cheers
<15> you can also use the dom's xpath parser to run an xpath query, get a nodeset, and loop over the nodeset as well


Name:

Comments:

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






Return to #php
or
Go to some related logs:

help.ubuntu digitus
wireless linux
#linux
hpacucli output
ubuntu bigmem howto
made in thaywan
#sdl
Cedega CVS.deb
hula nickserv
#linux



Home  |  disclaimer  |  contact  |  submit quotes