Skip to content

Preg_replace content with mysql query

I’m creating a replacement function. I have data in a db with a field ‘content’ that returns the content for a page. In that content I have a url tag like <a href=”[2]”>title</a>. The number between the [brackets] is the page_id of my pages table. I have a function ca…

How to sort an Array using If in PHP

I have the following Array which contains data such as: Card, Month and Year. However, I receive it in a disorganized way and I would like to treat these values to follow the pattern. No Card, Year and Month or Month, Card and Year. I tried to use the sort() functions of php, but without success! I would like…