How does this giant regex work?
I recently found the code below in one of my directories, in a file called doc.php. The file functions or links to a file manager. It’s quite nicely done. Basically, it lists all the files in the...
View ArticlePHP PDO: Can I bind an array to an IN() condition?
I’m curious to know if it’s possible to bind an array of values to a placeholder using PDO. The use case here is attempting to pass an array of values for use with an IN() condition. I’m not very good...
View ArticleJava: function for arrays like PHP’s join()?
I want to join a String[] with a glue string. Is there a function for this? Solution: Apache Commons Lang has a StringUtils class which has a join function which will join arrays together to make a...
View Articlephp replacement for safe_mode
i am new to learning PHP and so I’ve installed the latest version (5.3.3) and am writing some code. i have run across this error: PHP Warning: curl_setopt() [function.curl-setopt]:...
View ArticlePHP’s Iterator class
I am working with PHP’s SPL Recursive Iterators, they are rather confusing to me though but I am learning. I am using them in a project where I need to recursively grab all files and exclude folders...
View Articlecheckdnsrr always returns false on windows
I am using checkdnsrr on Windows with PHP 5.3 and it always returns false. dns_get_record, however, works. echo ("test.com dns check: ". checkdnsrr("test.com","NS")); //false!!...
View ArticleStrange behaviour after loop by reference – Is this a PHP bug?
I just had some very strange behavior with a simple php script I was writing. I reduced it to the minimum necessary to recreate the bug: <?php $arr = array("foo", "bar", "baz"); foreach ($arr as...
View ArticleForce composer to download git repo instead of zip
I have some problem with composer. "require": { "php": ">=5.3.2", "kriswallsmith/buzz": "0.7" }, Repo https://github.com/kriswallsmith/Buzz/tree/v0.7 Unfortunately github returns 502 for this...
View ArticleHow do I get current page full URL in PHP on a Windows/IIS server
I moved a WordPress installation to a new folder on a Windows/IIS server. I’m setting up 301 redirects in PHP, but it doesn’t seem to be working. My post URL’s have the following format:...
View ArticleList of Big-O for PHP functions
After using PHP for a while now, I’ve noticed that not all PHP built in functions as fast as expected. Consider the below two possible implementations of a function that finds if a number is prime...
View Article
More Pages to Explore .....