gettext is the GNU internationalization and localization (i18n) library. It is commonly used for writing multilingual programs. It has an implementation in a lot of different languages and it’s also commonly used in PHP applications.
Posted on 08 March 2012.
gettext is the GNU internationalization and localization (i18n) library. It is commonly used for writing multilingual programs. It has an implementation in a lot of different languages and it’s also commonly used in PHP applications.
Posted in PHPComments (0)
Posted on 05 March 2012.
stdClass is php’s generic empty class, kind of like Object in Java or object in Python (Edit: but not actually
Posted in PHPComments (0)
Posted on 04 March 2012.
Have you ever worked on a project that was so unwieldy, you were scared to update a file or add a feature? Maybe the problem was that you weren’t using a version control system. In today’s tutorial, we’ll learn the basics of what might possibly be the best VCS in the world: Git.
Posted in PHPComments (0)
Posted on 13 February 2012.
Your latest PHP/MySQL website is finally online. And it’s awesome. But it’s not as fast as you want it to be, because of the many SQL queries running every time a page is generated. And above that, you have the feeling it will not scale well under heavy loads. And you are most likely right.
Posted in Linux, PHPComments (0)
Posted on 12 February 2012.
Prosoxi.com php functions!
Posted in PHPComments (0)
Posted on 12 February 2012.
Fellow PHP programmers, I encountered a most peculiar problem today that I must share. I had a situation where someone was sending me POST data but the PHP $_POST array was empty. I setup a debugging script to see the GET and POST arrays and sure enough everything was empty. I asked my friend Google and found a neat way to get the raw incoming message using PHP:
$data = file_get_contents('php://input');
That convinced me that they were in fact sending me what looked like POST data but for some reason the PHP $_POST array was still empty. Long story short, what I discovered and hopefully what will save someone out there some time, is that if the Content-Type is empty or not recognized in the HTTP message then the PHP $_POST array is empty. Not sure if this is a bug or is by design…
Anyway if the guy on the other end can’t figure out how to send a properly formatted HTTP message, you can force the Content-Type as a last resort using something like this above where you want to access the $_POST array:
if(empty($_SERVER['CONTENT_TYPE'])){ $type = "application/x-www-form-urlencoded"; $_SERVER['CONTENT_TYPE'] = $type; }
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){ echo '<pre>',print_r($_POST, TRUE),'</pre><br /><br /><br />';}
?>
<form method="post" action=""> <input type="hidden" name="test1" value="one" /> <input type="hidden" name="test2" value="two" /> <input type="hidden" name="test3" value="three" /> <input type="submit" value="Test Me" /></form>
Source
http://www.bradino.com/php/empty-post-array/
http://stackoverflow.com/questions/1282909/php-post-array-empty-upon-form-submission
Posted in PHPComments (0)
Posted on 10 February 2012.
Uploading files without refreshing page looks nice and even simple. With the help of ajax and jquery one can achieve this. Today I have collected 7 ajax file upload plugins which are cool and easy to integrate.
Posted in JavaScript - AjaxComments (0)
Posted on 10 February 2012.
The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.
Posted in PHPComments (0)
Posted on 09 February 2012.
Use an HTML parser. NOT regular expressions.
The problem with regular expressions is that they cannot match nested structures. Assuming your regex must match a single <div> and its closing tag, there is no way to correctly match this input:
Posted in PHPComments (0)
Posted on 07 February 2012.
During the dark age, the simplest way to get previous row from current ID was using this query:
Posted in PHPComments (0)
Posted on 02 February 2012.
To upload a file to ftp you need a html form where you can insert the ftp details, like the ones described above:
Posted in PHPComments (0)
Posted on 01 February 2012.
You can use the method below to prevent duplicate form submission or form re-submission using PHP. This method is simple to implement and does not require JavaScript.
Posted in PHPComments (0)
Posted on 31 January 2012.

PHP 5.4.0 is planned to be released on February, 2 2012. By the time you are reading this, it may already been out. It is a result of many months of development.
Posted in News, PHPComments (0)
Posted on 30 January 2012.
gettext — Lookup a message in the current domain
Posted in PHPComments (0)
Posted on 09 January 2012.
Came across this today messing around with WAMP server. The index page it has has some images. I was looking to replace them as i was feeling lazy about creating an Index page
Posted in PHPComments (0)
Posted on 09 January 2012.
A couple of weeks ago I was going to work on a new project, it was a directory-like kind of app. One the things this application had to do was let users add their websites to their profiles, and so the first question came up, “how am going to get their website’s title and meta tags?”.
Posted in PHPComments (0)
