4 ms·
>You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning
by TazeTSchnitzel 13y ago
>You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.
And it's very, very difficult to do that properly, because PHP seems to go out of its way to make all of those things (APIs, DB management, security, functioning) difficult.
>And it will work on all servers and on all operating systems.
Except for UNIX, where function X does Y instead of Z, which it does on Windows. Usually, except in PHP 5.5 and above.
WARNING! If php.ini variable A is set to B, then the above does not apply and instead behaviour C takes effect.
- jtreminio 13y agoPHP's PDO is extremely easy to work with. Seriously, it's like 5 lines of code to connect to a database and retrieve information. Is that really all that difficult? Security? DB-wise, use PDO and named parameters. It's passing in an array. Sessions? For private servers, using file-based is fine. For shared or for scaling, use DB/memcache. APIs? It's dead easy to implement a RESTful interface. Interacting with remote APIs is nothing more than some curl commands, or your tool of choice. Explain to me what's so difficult here? Having a language behave slightly differently between different operating systems is ... expected? Maybe? I'm not sure, I never use PHP on Windows. Why would I?