Skip to content

php mysql export excel

This code is working without problem if page doesn’t contain any other content. When i add a html form, it gives only html content to excel. I need to use that form to customize query. How can i make this code working with html content? Answer As mentioned in the comments, combining HTML and CSV is not …

mysql sanitize row name

I’m currently writing a php framework with focus on security. I use a query builder to generate SQL-statements, so that it is not bound to MySQL. (Or SQL in general) I found certain posibilities that user could inject row names, so it has to escape them somehow. Because of how the query builder works, i…

Date and time in Greek

I’m currently using a website to get the time in Athens: $d = new DateTime(“now”, new DateTimeZone(“Europe/Athens”)); echo $d->format(“l, d M Y”); But I would like the date to be displayed in …

Writing Array to File in php And getting the data

I have An array which looks like following after using print_r Now I want to write this array direct to a file, I use the file_put_contents method, but I don’t know how to get the data from the file exactly how they looks like original. Any idea to solve this? Answer Your problem at the moment is basica…

Create link in pdf with tcpdf

How can I create a link with TCPDF? When using the writeHTML() function and passing my whole html content, TCPDF doesn’t make my links clickable. They are blue and underlined but I cannot click them. Here is what I did. Answer As per the documentation, you can use the Write() method on your TCPDF object…

Replacing text between two limts

I have been trying to get the text between two symbols to be replaced with preg_replace, but alas still not quite getting it right as I get a null output that is empty string, this is what I have so …

PHP how to detect if image contains color?

I am writing an image search engine, which allows users to search by colour. As part of this, I need to determine whether the image is grayscale (contains only black, white or shades of grey) or …