Sharag’s Tech Interview HELP

  • About
  •  

    November 2008
    M T W T F S S
    « Oct   Dec »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
  • Recent Posts

    • ALL CSS Interview question and answer
    • MNC php interview questions and answers
    • Aztecsoft php web developer interview questions and answers
    • XML Interview Questions and Answers
    • AJAX Interview Questions and Answers
  • Tags

    abstract class Advanced Answer Answers browser properties button CGI class CSS data date decrypt Design DOM echo encrypt form fresher get HTML include interface interview ip address Javascript LAMP mail MySQL object oops PHP post print Question questions require SAX SESSION shopping cart table Technical timestamp Web XML zend
  • Archives

    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • August 2008
    • June 2008
  • Blog Stats

    • 33,199 hits
  • Recent Comments

    Best4buys on important PHP interview questi…
    Best4buys on MNC php interview questions an…
    Best4buys on PHP Advanced Questions and Ans…
    Abdul Aziz on PHP OOPS Interview Questions …
    Hari on PHP OOPS Interview Questions …

PHP common interview questions – answers

November 26, 2008 — sharag

=,==,=== – what is the difference between these?

= assigns a value, == checks if value is the same, === checks if value is the same and the variables are of the exact same type.

Echo, print, printf – what is the difference between these?

Print and echo both output what is passed to them. Print acts like a function, so you can use it in complex statements. Printf is used to format the output.

Include, include once, require – what is the difference between these?

Include will includes a file each time it is called. Include_once would only include a file one time, so if a php program has a file in two include_once statements only the first will be done. Requre is like include, but if the file included is not available a fatal error occurs and processing stops.

Are variables passed to functions by reference or value?

A variable is passed by value unless the variable is passed with an &, such as functionName(&$variableName)

How do you encrypt data?

The PHP md5() function is very pretty widely used. The PHP crypt() function can also be used to encrypt data. (Honestly, the one time I had this question I drew a complete blank, so I’m not exactly certain what they were looking for.)

What editor or ide do you use?

Interesting question, probably does say something about your programming capabilites.  use Eclipse 3.1 with PHP extensions, , Zend Studio  Serious Unix users would be good with vi or emacs.

PHP  Static, what are they and how do you use them?

As with Java, if the job is for OO PHP (that is PHP 5), there will be a question on PHP static variables. You may be asked how to reference a static from inside and outside of the class it is in, or just show that you get the basic concept of a variable or function that is for the whole class and not an instance.

Design Patterns general questions

Now we are really into OO stuff. As in java job interviews I’ve usually been asked about design patterns in fairly vague terms, such as “describe the design patterns used in the systems you have worked on”. I was asked that so much that I drew out some UML to bring with me to interviews, as I found drawing up the UML during the interview to be distracting and slow.

How can I maintain the count of how many persons have hit my site?

The IP of a visitor can be tracked by
$ip = $_SERVER['REMOTE_ADDR'];
Just insert this value with date into a table.

What is difference between mysql_fetch_array(), mysql_fetch_row() and mysql_fetch_object()?

mysql_fetch_array()– Fetche resultset from a table in the form of array
Eg: $res= mysql_query(’select * from tbl’)
while ($row=mysql_fetch_array($res))
mysql_fetch_row()
Fetch single row
mysql_fetch_object()
Fetches resultset as object

How I can make a chat page in php in simple

On click on chat submit button store the values in the text area to a text file using PHP file functions.
you can use ajax fore improved user experiance.
wrie another javascript + ajax function to call the contents from the text file in each 3 sec

 

What is the difference between echo and print statement?

Print is a function and returns a value. Using echo we can use more than one parameter

echo “and a “, 1, 2, 3; 

What is differenc between mysql_connect and mysql_pconnect?

mysql_connect- Creates a connection with db

mysql_pconnect- creates a persistant connection with db 

How I can get IP address of the user?

)$ip = $_SERVER['REMOTE_ADDR']; 

How I will check that user is logged in or not?

store user information in session

I want to make it a function and I want to use it in each page and after login I want to go in current page?

)store url in a variable and put in session before

After login redirect page to that url 

How do we know browser properties?

var_dump($_SERVER); 

If you have to work with dates in the following format: “Tuesday, February 14, 2006 @ 10:39 am”, how can you convert them to another format, that is easier to use?

first remove @ from the string and than use strtime to convert this to unix time stamp.

What is difference between require_once(), require(), include()?

all are for including afile into another file
require- if fails shoot a fatal error
include- if fails shoot a warning

include/require_once- for make sure that the page is included once in another page

Posted in LAMP, MySQL, PHP. Tags: Answers, array, browser properties, chat, counter, Design Patterns, doubt, echo, encrypt, fetch, function, help, hits, interview, ip address, login, md5, MySQL, mysql connect, object, OOP, oops, page view, PHP, PHP 5, php editors, print, printf, questions, require, resultset, Static, Technical, timestamp. 4 Comments »
Blog at WordPress.com. • Theme: Garland by Steven Wittens and Stefan Nagtegaal.
  • Top Posts

    • Web Design HTML Interview Questions & Answers
    • PHP OOPS Interview Questions & Answers
    • HTML, CSS & JavaScript Web Designer or Web Developer Interview Questions
    • ALL CSS Interview question and answer
    • MNC php interview questions and answers
    • PHP Advanced Questions and Answers part one
    • PHP Interview Questions part 6 [asked in YAHOO interview]
    • PHP MySQL Interview Questions and Answers
    • Difference between php4 & php5
    • PHP interview questions & ANSWERS
  • Categories

    • AJAX
    • CSS
    • HTML
    • LAMP
    • MySQL
    • PHP
    • XML
  • Category Cloud

    AJAX CSS HTML LAMP MySQL PHP XML
  • Spam Blocked

    3,153 spam comments
    blocked by
    Akismet
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.com
  • SHARAG

  • Flickr Photos

    Field of Dreams

    Feather n Birds Tattoo

    15/365

    I Feel Good

    The Fairy Land

    Untitled

    National Geographic Selection

    Lake Road

    Snort (or should that be Snot)

    Moon over Sunshine Skyway bridge

    More Photos
  • Blogroll

    • Raghav’s Website
    • Raghav’s Wedding Anniversary
  • Top Clicks

    • flickr.com/photos/8567943…
    • sharag.files.wordpress.co…
    • en.wordpress.com/tag/styl…
    • php.net/manual/en/migrati…
    • flickr.com/photos/2039252…
  • Pages

    • About