PHP Programming
[PHP] Stripslashes and fwrite not working
I was working with one project and writing textarea’s data into one file using fwrite function of PHP. It keeps adding forward slash whenever single quote comes in string. I have tried to use stripslashes but it did not work. I tried stripslashes twice but it did not work as well.
When to Use Functions in PHP?
Whether you are new to programming or an intermediate programmer, learning new tricks can speed up your productivity and acquire more ideas for your program. This is also important for advanced programming languages such as PHP. The complexity of the language can be daunting at first, but thanks to using “Functions” in your code, it can save a lot of time by not having to type the code every time it is needed, and using less coding in your application.
[PHP] What is the difference between sort & asort in php ?
Many times developers are not aware with the core functions of PHP. PHP have sort and asort built in array functions. You may or may not be aware with these functions. But when you will face a PHP interview than you may be asked for this question.
[PHP] Warning: Cannot modify header information when Create a COOKIE
When you create COOKIE or try to set COOKIE, are you getting error like “Warning: Cannot modify header information – headers already sent” ? This happen if your page starts output on browser. COOKIE is at browser and it will not set if your browser has started output.
[PHP] Parse/Extract Domain name from URL
Do you need to parse only domain from current URL ? If yes than you are at the right place to get the PHP Code. PHP has parse_url built in function to parse a url parameters. This function will parse the url into an array. You can easily get the domain name from whole url of your page using parse_url function
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
SMTP -> ERROR: Failed to connect to server: Connection timed out (110). Connection time-out means the mail server cannot be reached anymore. If the mail server is different from your web server (i.e. not localhost) I had check with your hosting provider whether they enabled some sort of firewall that blocks connections on the SMTP port.
Remove Empty/Null Rows from array using PHP
I got so many empty element as well as null values in array and my SQL query is some what complex so i was not able to use IS NOT NULL in mysql Query. Only alternative way i have is removing this null values from array using PHP. I used is_null function of PHP and remove null elements from array.
PHP functions for Encrypt Decrypt a string
Here i am sharing php functions for encrypt decrypt a string. I came across two different ways of encrypt decrypt php functions for string. In first one, there are two functions for encrypt and decrypt string. One is for encrypt the string and other is for decrypt the encrypted string. In second one, there is only one encrypt decrypt function which works for both encryption and decryption of string in php.
How to include multiple javascript files in Zend Framework
If you are working with javascript files and using Zend Framework than you must be aware with how to include javascript files in view files ? Look at below syntax to include more than one javascript files. If you write individual statement for each file than it will include first file 2 times and so on.


I am
Recent Comments