Firstly I should say I am relatively new to PHP programming, to date most of my work has been using classic ASP. However, since I wanted to use FPDF, a free PDF engine, I have started to use PHP.
So far I have been able to add to and adapt the relevant code without problem, until yesterday.
Our report gets data from a MS SQL database and passes this to various functions to generate a PDF containing a table. This was working perfectly until I included a date field.
This generates an error on the following line:
I would love to include all the scripts but it would fill a good few pages. Having said that the error seems self-explanatory - strlen cannot be used with a date field. Given this variable is then used to set column widths etc. I cannot skip this line (and other string functions are used further down).
Therefore I need to check if $txt is a date, and if so convert to a string, preferably in the format 'd M y' (which I think would give dates like '01 Jan 2013'. In ASP I could have used
I have tried various suggestions from Google last night, all of which just resulted in the same error on a different line, or a different error.
Any help would be appreciated.