Find PHP Code Snippets
A repository of useful PHP code snippets to help on your projects.
Featured Snippets
Bulk Copy Directory Recursively
This function is used to copy a folder and all its contents and subfolders, its params are as follows: 1) The source folder path2) The
November 20, 2018 No Comments
November 16, 2018 No Comments
Clean Data From Line Breaks
When exporting data to CSV line breaks can cause problems getting the data into the correct columns, removing them is the best course of action.
November 16, 2018 No Comments
Split Words Based on Capital Letter
Using preg_split to separate words where a capital letter is found.
November 16, 2018 No Comments
Remove Money Formatting
This will remove all non-integer characters, including commas and currency symbols. The output is a float.
July 2, 2018 No Comments
August 18, 2016 No Comments
Have your own useful snippets?
Do use snippets of PHP code to help in your dev project? Let us know and we’ll add them to our directory.