|
fletcher posted:What's the point of declaring public variables in a class? If I remove them all, my application will behave the same, correct? Not quite sure what you mean by that. Basically public fields are accessible from any code: php:<? class Foo { public $baz; } class Bar { private $baz; } $foo = new Foo; $bar = new Bar; $foo->baz = 'baz'; // No problem here. $bar->baz = 'baz'; // Fatal error! ?> Inquisitus fucked around with this message at 19:57 on Mar 28, 2008 |
# ¿ Mar 28, 2008 19:54 |
|
|
# ¿ Apr 30, 2024 16:33 |
|
duz posted:You're supposed to use braces when you want the contents of a variable. Alternatively: php:<? $string = "The quick $data[colour] fox jumps over the lazy dogs." ?>
|
# ¿ Apr 4, 2008 20:58 |
|
MononcQc posted:Adding braces around $array[$value[1]] to get {$array[$value[1]]} was the best way to get the arrays to work properly. PHP
|
# ¿ Apr 5, 2008 17:29 |
|
nbv4 posted:I have this one class which is getting so huge, it's almost 2000 lines. I want to split it up into smaller text files to make editing easier, but I'm having trouble doing so. Apparently you can't just do: Either try and split the class up logically into smaller classes, or leave it as it is if you can't.
|
# ¿ Apr 7, 2008 18:17 |
|
Actually an ORM layer is far better suited to your needs. Inquisitus fucked around with this message at 09:51 on Apr 10, 2008 |
# ¿ Apr 10, 2008 09:46 |
|
LOL AND OATES posted:if cURL isn't enabled, use file_get_contents: Or just readfile it: code:
|
# ¿ Apr 14, 2008 22:27 |
|
gibbed posted:Drop the trailing ?> too, there is no need for it in this script. That's just taking it too far gibbed posted:Edit: wait why the hell did you put a \r\n in the header() call? That was me getting confused between header and mail (which I'd just been using and takes headers as a string, hence needing line breaks).
|
# ¿ Apr 15, 2008 00:17 |
|
You need to put quotes around associative array indices:php:<? if ($getclub['private'] == 1) { // ... } // ... if ($getmemberdata4['id']) { // ... } ?>
|
# ¿ Apr 21, 2008 16:20 |
|
MVC theory question: I'm currently playing around with the Propel ORM framework and trying to work out how best to integrate it into Kohana (an MVC framework). My question is how should I go about transforming Propel's generated data objects when they're passed through the controller and into the view? Leaving them as they are would be exposing details of the data layer to the presentation layer, but constructing a new object for each one seems completely over the top. Not sure how to proceed; please advise!
|
# ¿ Apr 21, 2008 17:01 |
|
duck monster posted:Back a whole bunch of pages was the question "How to stop image leeching". I like this idea
|
# ¿ May 1, 2008 09:36 |
|
hallik posted:I have been looking around, but can't find a good explanation of using multiple $$$ Basically $$foo takes the value in the variable $foo and uses it as a variable name for accessing the another variable (this is what the first $ is doing). So if $foo had the value of "baz", then PHP would just access $baz. hallik posted:Or how about how math is done with the e^ stuff. (Sorry if this isn't clear. I was taking some online tests, and have never had to use exponents or that ^, but it wanted me to know) Not really sure what's being asked here. Are you asking how exponentials are computed algorithmically?
|
# ¿ May 11, 2008 05:00 |
|
hallik posted:Yeah, I guess this is what I am asking for. I just remember seeing a question with that junk in it, and I was like huzzaah? I haven't seen that since h.s. alegbra, and haven't needed it since. It was a test to check my skills in the language, which weren't good, but I was thrown off by the exponent stuff. I don't even remember how they work. Isn't that why we have computars? I know it's good to know, but I just don't remember them, or how they are applied in PHP. You really don't need to know how exponentials are actually computed at the algorithmic level. I don't know myself, but I imagine it'd be something to do with Taylor expansions. If you just want to get the result of an exponential with base e, then use PHP's exp function. Inquisitus fucked around with this message at 10:05 on May 11, 2008 |
# ¿ May 11, 2008 10:02 |
|
Can anyone think of a way to detect whether a class is abstract in PHP? I don't care if it's kinda hacky just as long as it's fool-proof and preferably doesn't involve digging into the source itself Edit: reflection duh Inquisitus fucked around with this message at 15:25 on Aug 5, 2008 |
# ¿ Aug 5, 2008 15:20 |
|
|
# ¿ Apr 30, 2024 16:33 |
|
Mine GO BOOM posted:Hashing a hash only increases the chance of collisions and doesn't make it more secure. Collisions aren't a problem if you're salting; the point is that hashing that many times would gently caress up rainbow tables since they'd take millennia to generate and bruteforcing would also be slow as poo poo.
|
# ¿ Aug 22, 2008 02:51 |