As we know that the PHP session ids are saved in Cookies. To make a cookie available in all the sub-domains you need to assign it to the root domain. Then all the sub-domains will get the session id from cookie and PHP can find the session using passed session id. (more…)
Usually we do remove duplicate words from a text using array functions etc, but it’s quite slow doing that way because of the size of the text. The fastest way to achieve the same result is PHP regex. You can remove duplicate words using PHP regular expressions with preg_replace. Below is a complete PHP example code using regular expression to remove duplicate words from a text using PHP.
We often need to convert a PHP array to a query string for use in a URL or POST request, and vice versa. Really PHP is very rich with its build in functions as it has very useful function http_build_query() to convert a PHP array to a query string. Here in this post, I have an example to convert a PHP array to query string.