Skip to main content

Posts

Showing posts from June, 2012

Openings for different technoogies.

PHP History And Information

With an increasing community; PHP is considered today as one of the most famous scripting languages. It is widely used today as a general purpose scripting language, particularly useful for web developments and like other scripting languages; it can also be embedded directly into the HTML code. Within a short span of time, PHP has gained remarkable popularity and its community is increasing rapidly. There are various reasons for that, for instance: My security bunny found a more fortified position PHP, as you may know, is a free software and anyone can download it; use it and it supports various operating systems The syntax of PHP is quite similar to C which makes it more appealing for computer programmers. Whatever you have done with Perl in the past, you can do it with PHP. PHP is web specific and is more powerful than Perl. PHP works equally well and can be deployed on many web servers like Apache, IIS etc PHP scripts can be used for various standard network pro

Latest PHP Interview Questions

6) What is the difference between echo and print? Main difference between echo() and print() is that echo is just an statement not a function and doesn't return's value or it just prints a value whereas print() is an function which prints a value and also it returns value. We cannot pass arguments to echo since it is just a statement whereas print is a function and we can pass arguments to it and it returns true or false. print can be used as part of a more complex expression whereas echo cannot. echo is marginally faster since it doesn't set a return value. 7) An examiner awards the highest mark 75 and the lowest mark 25, the pass marks being 40. The moderator wants to change the highest mark to 250 and the lowest marks to 100 using the linear formula y=ax+b. The revised pass marks will be: A. 145 B. 150 C. 160 D. 400/3 Give the correct option. y=ax+b 100=25a+b 250=75a+b Solve it get and b and then put y=40a+b Answer: 145 8) A and B are shooters and having their exam. A

PHP Interview Questions

1) What is the difference between strstr & stristr? For strstr, the syntax is: string strstr(string $string,string $str ); The function strstr will search $str in $string. If it finds the string means it will return string from where it finds the $str upto end of $string. For Example: $string = "http://yahoomail.com"; $str="yahoomail"; The output is "yahoomail.com". The main difference between strstr and stristr is of case sensitivity. The former consider the case difference and later ignore the case difference. 2) What is the difference between explode and split? Split function splits string into array by regular expression. Explode splits a string into array by string. For Example: explode(" and", "India and Pakistan and Srilanka"); split(" :", "India : Pakistan : Srilanka"); Both of these functions will return an array that contains India, Pakistan, and Srilanka. 3) How can you avoid execution time out err

PHP Interview questions 1

1) What type of inheritance that PHP supports? Ans :      In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported. Classes are extended using the keyword 'extends'. 2) What is the difference between Primary Key and Unique key? Ans :      Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL. Unique Key: Unique Keys are used to uniquely identify each row in the table. There can be one and only one row for each unique key value. So NULL can be a unique key.There can be only one primary key for a table but there can be more than one unique for a table.                   3) what is garbage collection? default time ? refresh time? Ans : Garbage Collection is an automated part of PHP , If the Garbage Collection process runs, it then analyzes any files in the /tmp for any session files that have not been accessed in a certain amount of time

PHP Interview questions 2

1) How we load all classes that placed in different directory in one PHP File , means how to do auto load classes Ans :      by using spl_autoload_register('autoloader::funtion'); Like below class autoloader { public static function moduleautoloader($class) { $path = $_SERVER['DOCUMENT_ROOT'] . "/modules/{$class}.php"; if (is_readable($path)) require $path; } public static function daoautoloader($class) { $path = $_SERVER['DOCUMENT_ROOT'] . "/dataobjects/{$class}.php"; if (is_readable($path)) require $path; } public static function includesautoloader($class) { $path = $_SERVER['DOCUMENT_ROOT'] . "/includes/{$class}.php"; if (is_readable($path)) require $path; } } spl_autoload_register('autoloader::includesautoloader'); spl_autoload_register('autoloader::daoautoloader'); spl_autoload_register('autoloader::moduleautoloader'); 2) How many types of Inhe

PHP Interview questions 3

6) how to track no of user logged in ? Ans :      whenever a user logs in track the IP, userID etc..and store it in a DB with a active flag while log out or sesion expire make it inactive. At any time by counting the no: of active records we can get the no: of visitors. 7) in PHP for pdf which library used? Ans :      The PDF functions in PHP can create PDF files using the PDFlib library With version 6, PDFlib offers an object-oriented API for PHP 5 in addition to the function-oriented API for PHP 4. There is also the » Panda module. FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs. FPDF requires no extension (except zlib to activate compression and GD for GIF support) and works with PHP4 and PHP5. 8) for image work which library? Ans :      we will need to compile PHP with the GD library of image funct

PHP Interview questions 4

1) what is magic quotes? Ans :      Magic Quotes is a process that automagically escapes ncoming data to the PHP script. It’s preferred to code with magic quotes off and to instead escape the data at runtime, as needed. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged. 2) what is cross site scripting? SQL injection? Ans :      Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which allow code injection by malicious web users into the web pages viewed by other users. Examples of such code include HTML code and client-side scripts. SQL injection is a code injection technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby

PHP Interview questions 5

1) what is MVC? why its been used? Ans :      Model-view-controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model. WHY ITS NEEDED IS 1 Modular separation of function 2 Easier to maintain 3 View-Controller separation means: A Tweaking design (HTML) without altering code B — Web design staff can modify UI without understanding code                  2) what is framework? how it works? what is advantage? Ans :      I