Priti's Technical Corner

May 11, 2009

PHP Interview Questions

Filed under: PHP — Tags: , , , , , — pritisolanki @ 5:20 am

Question : What is WSDL?
Answer : WSDL document defines services as collections of network endpoints.Types ,element,Operations,port type,Binding,port,Service are the element involved to defined WSDL document.Question : what memory_get_usage function do?
Answer   :Return the amount of memory assigned to your PHP script.

Question: Where call_user_func helps?
Answer:
call_user_func — Call a user function given by the first parameter
<?php
function barber($type)
{
echo “You wanted a $type haircut, no problem”;
}
call_user_func(‘barber’, “mushroom”);
call_user_func(‘barber’, “shave”);
?>

Question: Is it possible to define constant in interface?
Answer : Yes, interface constant exactly works like class constants.

Question
: what is $php_errormsg?
Answer :$php_errormsg store the previous error message generated by PHP.This variable will only be available within the scope in which the error occurred.

Advertisements

2 Comments »

  1. Hi,
    Here are few more questions.

    1) how to delete an element from an array in php
    Ans. unset($array[$element_index]) and then use $array = array_values($array)

    2) how to make sure array exists in php
    Ans. is_array($array)

    3) explain overloading concept in php
    Ans. look in php manual for function __get() and function __set()

    4) how to use php in java and/or java in php.
    Ans. php in java servlet can be used using SAPI module. And java servlet in php can be used using java plugins. For second part, one needs to set java.path and other variables in php.ini

    Comment by milan — August 31, 2009 @ 5:32 pm

  2. ALTER TABLE t1 ENGINE = InnoDB;

    Comment by pritisolanki — October 5, 2009 @ 1:40 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: