PHP
-
Country codes as PHP array
EN: I’m working on some client’s site and found myself in need of country names and codes written as PHP array. As finding the right list is relatively easy (maybe except polish names…) it was a bit harder to find it as PHP code. So I took Wikipedia list (it has all informations I need) and parse it to PHP array. Here is result, you may copy it for your project. PL: Pracując nad projektem dla klienta, zdałem sobie sprawę, że będę potrzebował listy państw wraz z ich kodami. Nie znalazłem takiej listy (szczególnie z polskimi nazwami), więc wziąłem listę z Wikipedii i przerobiłem na kod. Dodatkowo ten kod sobie…
-
Showing all errors and warnings
Sometimes, when you write PHP code, you may need to see every single error, warning or even notice. And this is a very good practice in your development environment. If you can write your code and after all tests there are not a single notice, you may think your code is ready. Of course it doesn’t mean it is good, it’s different thing. But suppressing (by handling, not by @!) all errors, warnings and notices are a very good first step. How to make PHP show all errors and warnings? It’s very easy: [crayon-67025cd4cb52b743500689/] And that’s all. Oh no, one more thing. Do not enable this on production server! Every…