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 …
Tag: 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 …
How do I run a PHP script using windows schedule task?
I have installed localhost/server in my machine and I need to run a php script using windows schedule task. how do I add path in “Actions” tab in schedule task / cofigure the script to run for particular period? Answer Locate the php.exe executable on your system and pass it the name of the script…
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…
Why is PHP considered to be the easiest web programming language to learn? [closed]
It is widely believed that PHP is the easiest programming language to learn for a beginner. The argument goes that PHP is the easiest language to use for getting a quick prototype up-and-running. Why …
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….
Codeigniter variables from constructor are undefined
I’m using CI’s Auth Tank library to query records for certain users. The variable $user_id = tank_auth->get_user_id(); grabs the user id from the session. I want to pull records where user_id = $user_id. From what I understood, constructors can load variables each time a class is initiated. Sor…
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?
How can I format the number for only showing 1 decimal place in php?
Does any one know how can I format the number and limited it to only show 1 decimal place in php? Example: How can I format the number 2.10 to 2.1 in php?
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,…