![]() |
I'm board, ask me PHP related questions.
I'm bored, it's Saturday night and I'm home trying to force myself to work, but I don't want too.. So help me get in the mood and ask me any PHP related question, and I'll answer as best as I can. :thumbsup
|
Fuck, and I just noticed I spelled bored, board... :Oh crap
|
What are your rates? :1orglaugh
|
have you found a use for its new goto function?)
|
Why is needle/haystack not consistent in logical order?
|
When I display an echo only executed with an if statements on the same page, it seems like that echo is on the page BEFORE I execute the code (for example, age verification validation)
Like this: PHP Code:
How the fuck do I do this? Im new to php.. |
Quote:
|
Quote:
Quote:
Quote:
Quote:
PHP Code:
|
Thanks for the proposed help.
Hey, I got a CMS (updatem.com url defunct now) from 2005 running my member's area updates. It works great, I couldn't live without it. My questions are: is the script still secured to use, even though we are now at PHP5.something? Should it be reviewed/rewritten? Thanks in advance for your time MajorTom |
Quote:
|
Quote:
|
Your opinion on the difference in speed between switch and if when comparing a string against several regex's?
|
Quote:
|
Why does this work? Why does this show the email address?
#1 Code:
<?php but this doesn?t? #2 Code:
<?php #3 Code:
<?php :helpme:helpme:helpme:helpme |
Quote:
PHP Code:
|
Quote:
#1 works, because you're extending a class, but not overriding any functions - so the object $user has inherited all the properties and methods of person - basically, you've cloned it. #2 doesn't work, because you've declared $email in the parent class as private. If you wanted to access that, you'd have to use something like the third method, using an accessor - ie parent::getEmail() - or declare the variable as public (not so good) |
Quote:
|
Quote:
I really don't see much difference with var or public. protected $email = 'foo'; works also |
Quote:
|
Quote:
Thanks bro |
Quote:
For understanding private/public/protected visibility, take a look at this OOP tutorial http://www.brainbell.com/tutorials/php/TOC_oop.html |
What does PHP stand for?
|
Quote:
now it stands for Hypertext Preprocessor. :upsidedow |
Quote:
|
Quote:
He said he was bored so I thought I would give him a little something. It was not a question I had, or anything I was working on, but merely something to take away boredom. :1orglaugh |
Quote:
Code:
<?php Quote:
Code:
<?php Quote:
Code:
<?php Also, you shouldn't be defining properties like that. That should be done in the constructor. The only time you'd do that are with class constants. http://www.php.net/construct |
What's the best PHP framework?
|
Quote:
To clarify, any developer worth more than a penny should already have developed his own toolset of objects. I have my own and can develop complex/scalable applications very quickly because of it. I could give a fuck less if another programmer thinks that developing apps in the latest OOP style using abstracted classes (like Zend Framework) is a good idea... I know from experience that apps built in that fashion run like shit. There is much more to consider, when building an app, than how fancy your code is. Here is a super simple example of a framework I wrote and use alot. The one I actually use is alot more robust and secure... but, if you consider what it does, you will get the idea behind how I code applications. http://www.phpclasses.org/browse/package/4963.html Using this simple framework, you can build apps with SE friendly URLs where each URL is a seperate module, class and views. It is a little different than the MVC type of framework because I don't really like the Model/Controller model like you find in Zend Framework, Cake or Symphony. I also don't like template classes like Smarty, so I just use php in my templates. The simple beauty of this method is that, if I want to add new functionality, I don't even have to mess with any of the existing code except the bootstrap (index.php), where I add the includes. All I need to do is create a module class (memberModule.php), a class to handle functionality and my view templates. Any classes that I define in the bootstrap (like a database object), are available to the module... So I have a very scalable solution right from jump. |
All times are GMT -7. The time now is 06:32 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123