Browsing: PHP Snippet

This section contains various php snippet or call it hacks related to dates, database, files, basic programming and many more. These codes proves more than useful in day to day programming.

PHP Snippet Php Snippet
2

In production you don’t want your end user to see warning messages in case of any logical mistakes. You can suppress warning messages in php using error_reporting() function.

PHP Snippet Php Snippet
0

Have you ever tried putting an array in a named constant. Yes it will give an error as the manual says only scalar and null values are allowed. Scalar values are integer, float, string or boolean values. But if there’s a will there’s a way. Here’s an alternative approach to define array in a constant.

PHP Snippet Php Snippet
1

This PHP snippet will print last month date range (first day of month and last day of month). If you provide some other date other than current month it will print date range of that month starting from that day onwards.

PHP Snippet Php Snippet
1

This PHP snippet will print next month date range (first day of month and last day of month). If you provide some other date other than current month it will print date range of that month starting from that day onwards.

PHP Snippet Php Snippet
0

This PHP snippet will print current month date range (first day of month and last day of month). If you provide some other date other than current month it will print date range of that month starting from that day onwards.

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.