Skip to content

Tag: php

How to enable gzip?

I have found a couple of tutorials on how to enable gzip, but nothing seems to be working for me, so my question is how do i enable gzip. I am on a shared Dreamhost hosting server, It is running PHP …

Formatting Phone Numbers in PHP

I am working on an SMS app and need to be able to convert the sender’s phone number from +11234567890 to 123-456-7890 so it can be compared to records in a MySQL database. The numbers are stored in …

PDO’s query vs execute

Are they both do the same thing, only differently? Is there any difference besides using prepare between and ? Answer query runs a standard SQL statement without parameterized data. execute runs a prepared statement which allows you to bind parameters to avoid the need to escape or quote the parameters. execu…

tcpdf imagebox and cropping

I would like to add a ‘imagebox’ a box which contains the image and crops exceeding image value that is outside of this box. something like this: I am not sure on how to do this if it’s even possible….

add existing pdfs to fpdf

Is there any function that I could call in order to include an existing pdf in my fpdf file? For example $pdf->AddPage(from file example.pdf); something like that? is it posible?

MySQL and PHP – insert NULL rather than empty string

I have a MySQL statement that inserts some variables into the database. I recently added 2 fields which are optional ($intLat, $intLng). Right now, if these values are not entered I pass along an empty string as a value. How do I pass an explicit NULL value to MySQL (if empty)? Answer To pass a NULL to MySQL,…