PHP

How many ways we can retrieve the date in result set of mysql Using php?

As individual objects so single record or as a set or arrays.

Who is the father of php and explain the changes in php versions?

Rasmus Lerdorf for version changes go to http://php.net/

Marco Tabini is the founder and publisher of php|architect.

What are the differences between GET and POST methods in form submitting, give the case where we can use get and we can use post methods?

On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method. On the browser side, the difference is that data submitted by the GET method will be displayed in the browser’s address field. Data submitted by the POST method will not be displayed anywhere on the browser.

GET method is mostly used for submitting a small amount and less sensitive data. POST method is mostly used for submitting a large amount or sensitive data.

More >

What do you need to use the image functions in PHP?

You need to have access to the GD Library in order to use the image functions in PHP.

How do you remove the last letter from a string?

There are many ways to do this. An interviewer will be looking for you to use a compact method. Here is probably the simplest method:

$data = “One too many letterss”; $newdata = substr($data,0,-1);// now ‘one too many letters’

What’s the difference between md5(), crc32() and sha1() crypto on PHP?

The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.

How do you access data submitted through GET or POST from a form?

To access data use $_GET and $_POST respectively. For instance if a form is submitted with a field named ‘email’ through post, then this becomes available as $_POST[email].

With GET, the information is posted in the URL so this is useful if you want to store or bookmark a URL that relies on parameterised data. However GET is less secure, and also has strict limits on the amount of data that can be sent.

What’s the difference between htmlentities() and htmlspecialchars()?

htmlspecialchars only takes care of <, >, single quote ‘, double quote ” and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.

With a heredoc syntax, do I get variable substitution inside the heredoc contents? -

Yes.

What is the difference between characters ?23 and x23?

The first one is octal 23,the second is hex 23.