Today I learned about PHP parse_str. Worth checking out too are the related functions such as http_build_query.
Category Archives: Programming
PHP: The Right Way
Over on the ProgClub programming list Justin pointed out PHP: The Right Way which is definitely on my reading list.
100% Apache-Compliant REQUEST_URI for IIS and Windows
I had a problem with the REQUEST_URI server variable not being available in my PHP app when running under IIS on Windows. I followed these instructions to fix the problem: 100% Apache-Compliant REQUEST_URI for IIS and Windows.
I had to download and install ISAPI Rewrite 3 and Request_URI for IIS 1.1 which I installed into PHP by editing my php.ini file with this line:
auto_prepend_file = C:\Program Files\PHP\request_uri.inc
Facebook Games
The Reality of HTML5 Game Development
Read an article the other day which talks about all the different approaches you can take to creating a web-based game: The Reality of HTML5 Game Development and making money from it.
PHP heredoc syntax
Today I found myself looking up the PHP heredoc syntax. It was cool to learn that you can use {$var} syntax to embed variable data in a heredoc.
Using arrays in PHP
Apparently in PHP 5.4 you can index an array returned from a function as explained here. I learned this today but unfortunately I’m still running PHP 5.3. I also read an article on stackoverflow about how to make an object behave like an array.
MySQL cheat-sheet
Learned a trick or two from this MySQL Cheat Sheet.
MySQL function LAST_INSERT_ID like @@IDENTITY
There is a MySQL function to return the auto-increment ID of the last inserted ID and that is LAST_INSERT_ID. You can also read about Using AUTO_INCREMENT.
Inserting multiple rows with an insert statement in MySQL
Today I had to double-check the syntax for doing multiple row inserts in a MySQL insert statement, because my first guess at the syntax was wrong. I found this article which explained the syntax which is basically:
INSERT INTO example (example_id, name, value, other_value) VALUES (100, 'Name 1', 'Value 1', 'Other 1'), (101, 'Name 2', 'Value 2', 'Other 2'), (102, 'Name 3', 'Value 3', 'Other 3'), (103, 'Name 4', 'Value 4', 'Other 4');