Skip to content

Tag: php

Different session ID every time session_start is executed

I have the following source code session1.php session2.php when I access session1.php then access session2.php, I get a different ouput. Why is this doing it? Answer The browser is not sending the session cookie back to the server. This can have two reasons. The browser is configured not to send cookies to th…

How to convert PNG to 8-bit PNG using PHP GD library

I want to write a routine which takes PNG image path as parameter and convert that image into 8-bit PNG image. I need to use PHP GD library for this. Answer To convert any PNG image to 8-bit PNG use this function, I’ve just created function convertPNGto8bitPNG () Parameters $sourcePath – Path to s…

Permutations of an array of arrays of strings

I simply cannot wrap my head around how to solve this problem and after a thorough search on Google with no results, I turn to you with hopes of a solution. Given the sample array below: (Note: This is merely a sample; the actual real life situation might have less/more groups and/or elements per group) How w…

“Function split() is deprecated” in PHP?

Deprecated: Function split() is deprecated in C:wampwwwRSS.php on line 27 Why this error happen ? Answer http://php.net/manual/en/function.split.php From the manual Warning This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged Note: As of PHP 5.3.0, the regex extensi…