Tag Archives: best practice

substr() cuts in the middle of & symbol

Description: In “Read more” segments, you often need to cut the text to a length and add ‘…’ at the end. This can be a bit tricky when the limit falls on a special character. Solution: We can use mb_substr() … Continue reading

Posted in Best practices, PhP | Tagged , , , , | Leave a comment

Remove remote branch with GIT

Description: Having pushed a wrongly extended branch to origin, or you just don’t need to have a branch both locally and remote. Solution: Locally, deleting the branch was covered in a previous article. However, there are some cases that require … Continue reading

Posted in Version control | Tagged , , , , , | Leave a comment

Send e-mail with Undisclosed Recipients

Description: For privacy purposes, it’s often required to send a mass e-mail message without wanting one recipient to know about the identities of the others. Solution: The field “BCC”, representing a “blind carbon copy” can be used to have privacy … Continue reading

Posted in Best practices, Tools | Tagged , , , , | Leave a comment

Adding correct phpDoc

Description: Each class or method should include the php documentation at the beginning of the definition. Solution: The average phpDoc for a PhP class should contain the following information: /** * Short description of the class/method * Long description of … Continue reading

Posted in Best practices | Tagged , , | Leave a comment