Posts under PHP

WordPress Plugin Dev: How to send email using SMTP?

advertisement

wordpressIf you are doing WordPress plugin development that need to send out email, i think it’s a good idea to set the SMTP settings in your own plugin instead of using other third party SMTP plugin. It’s not that third party plugin is not good, but some times due to the plugin priority issue, the email might not sent out. This might because of the priority issue.

To send email using SMTP in your own WordPress plugin, follow the code below:-

Continue reading WordPress Plugin Dev: How to send email using SMTP? »

How to strtolower an array in PHP?

advertisement

php Many times we store our data in array and need to perform some additional function to the array like strtolower, strtoupper, and etc. Before i get to know this handy function, I’ve been searching for the shortest code to perform strtolower to an array in php. Thank god, finally i found array_map function and it solved my many years problem.

To strtolower an array in php, use the code below:-

Continue reading How to strtolower an array in PHP? »

Symfony Filter: Change ForeignKey drop down to Text field

advertisement

symfonyI tried to change the foreignkey drop down to text field in the symfony filter form. But after i change the drop down field to text field, my field name changed to xxx_filter[‘foreign_id’][‘text’] instead of xxx_filter[‘foreign_id’]. And everytime i submit the form it show “SQLSTATE[HY093]: Invalid parameter number: parameter was not defined”.

After few hours of googling, i manage to find the solution for this filter form problem. To solve the problem follow the steps below:-

Continue reading Symfony Filter: Change ForeignKey drop down to Text field »