SlideShare una empresa de Scribd logo
1 de 8
Descargar para leer sin conexión
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                PHP Interview Questions

PHP Interview Questions:

1. What's PHP?

The PHP Hypertext Preprocessor is a programming language that allows web developers to create
dynamic content that interacts with databases. PHP is basically used for developing web based software
applications.

2. How can we know the number of days between two given dates using PHP?

$date1 = date('Y-m-d');

$date2 = '2006-07-01';

$days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24);

echo "Number of days since '2006-07-01': $days";

3. How do you define a constant?

define ("MYCONSTANT", 100);

4. What is meant by urlencode and urldecode?

urlencode() returns the URL encoded version of the given string. URL coding converts special characters
into % signs followed by two hex digits.

For example:

urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of
URLs.

urldecode() returns the URL decoded version of the given string.

5. How To Get the Uploaded File Information in the Receiving Script?

Uploaded file information is organized in $_FILES as a two-dimensional array as:

$_FILES[$fieldName]['name'] - The Original file name on the browser system.

$_FILES[$fieldName]['type'] - The file type determined by the browser.

$_FILES[$fieldName]['size'] - The Number of bytes of the file content.

$_FILES[$fieldName]['tmp_name'] - The temporary filename of the file in which the uploaded file was
stored on the server.

$_FILES[$fieldName]['error'] - The error code associated with this file upload.
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                    PHP Interview Questions



6. What is the difference between mysql_fetch_object and mysql_fetch_array?

MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all
matching records from the table in an array

7. How do you pass a variable by value?

Just like in C++, put an ampersand in front of it, like $a = &$b.

8. How can we send mail using JavaScript?

No. There is no way to send emails directly using JavaScript.

But you can use JavaScript to execute a client side email program send the email using the "mailto"
code. Here is an example:

function myfunction(form)

{

tdata=document.myform.tbox1.value;

location="mailto:mailid@domain.com?subject=...";

return true;

}

9. What is the difference between ereg_replace() and eregi_replace()?

eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when
matching alphabetic characters.

10. How do I find out the number of parameters passed into function ?

func_num_args() function returns the number of parameters passed in.

11. Are objects passed by value or by reference?

Everything is passed by value.

12. What are the differences between DROP a table and TRUNCATE a table?

DROP TABLE table_name - This will delete the table and its data.

TRUNCATE TABLE table_name - This will delete the data of the table, but not the table definition.
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                    PHP Interview Questions




13. How do you call a constructor for a parent class?

parent::constructor($value)

14. How can we submit a form without a submit button?

If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a
form. But you need to use some JavaScript code in the URL of the link.

<a href="javascript: document.myform.submit();">Submit Me</a>

15. How can we extract string 'abc.com ' from a string http://info@abc.com using regular expression
of php?

We can use the preg_match() function with "/.*@(.*)$/" as the regular expression pattern.

For example:

preg_match("/.*@(.*)$/","http://info@abc.com",$data);

echo $data[1];

16. What is the difference between the functions unlink and unset?

unlink() is a function for file system handling. It will simply delete the file in context.

unset() is a function for variable management. It will make a variable undefined.

17. What is the difference between characters 047 and x47?

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

18. How can we create a database using PHP and mysql?

We can create MySQL database with the use of mysql_create_db($databaseName) to create a database.

19. How can we destroy the session, how can we unset the variable of a session?

session_unregister() - Unregister a global variable from the current session

session_unset() - Free all session variables

20. How can we know the count/number of elements of an array?

a) sizeof($array) - This function is an alias of count()
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                  PHP Interview Questions

b) count($urarray) - This function returns the number of elements in an array.

Interestingly if you just pass a simple var instead of an array, count() will return 1



21. How many values can the SET function of MySQL take?

MySQL SET function can take zero or more values, but at the maximum it can take 64 values.

22. What are the other commands to know the structure of a table using MySQL commands except
EXPLAIN command?

DESCRIBE table_name;

23. How can we find the number of rows in a table using MySQL?

SELECT COUNT(*) FROM table_name;

24. How can we find the number of rows in a result set using PHP?

$result = mysql_query($any_valid_sql, $database_link);

$num_rows = mysql_num_rows($result);

echo "$num_rows rows found";

25. What is the difference between CHAR and VARCHAR data types?

CHAR is a fixed length data type. CHAR(n) will take n characters of storage even if you enter less than n
characters to that column. For example, "Hello!" will be stored as "Hello! " in CHAR(10) column.

VARCHAR is a variable length data type. VARCHAR(n) will take only the required storage for the actual
number of characters entered to that column. For example, "Hello!" will be stored as "Hello!" in
VARCHAR(10) column.

26. What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?

mysql_fetch_array - Fetch a result row as an associative array and a numeric array.

mysql_fetch_object - Returns an object with properties that correspond to the fetched row and moves
the internal data pointer ahead. Returns an object with properties that correspond to the fetched row,
or FALSE if there are no more rows

mysql_fetch_row() - Fetches one row of data from the result associated with the specified result
identifier. The row is returned as an array. Each result column is stored in an array offset, starting at
offset 0.
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                    PHP Interview Questions

27. What is the difference between htmlentities() and htmlspecialchars()?

htmlspecialchars() - Convert some special characters to HTML entities (Only the most widely used)

htmlentities() - Convert ALL special characters to HTML entities



28. How can we get the properties (size, type, width, height) of an image using php image functions?

image size use getimagesize() function

image width use imagesx() function

image height use imagesy() function

29. How can we increase the execution time of a php script?

By the use of void set_time_limit(int seconds)

30. What are the difference between abstract class and interface?

Abstract class: abstract classes are the class where one or more methods are abstract but not
necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its
class but not define. The definition of those methods must be in its extending class.

Interface: Interfaces are one type of class where all the methods are abstract. That means all the
methods only declared but not defined. All the methods must be define by its implemented class.

31. What is the maximum size of a file that can be uploaded using PHP and how can we change this?

change maximum size of a file set upload_max_filesize variable in php.ini file

32. Explain the ternary conditional operator in PHP?

Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed,
otherwise, the expression following : is executed.

33. What’s the difference between include and require?

It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the
execution of the script. If the file is not found by include(), a warning will be issued, but execution will
continue.

34. How many ways can we get the value of current session id?

session_id() returns the session id for the current session.

35. What is the difference between $message and $$message?
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                  PHP Interview Questions

They are both variables. But $message is a variable with a fixed name. $$message is a variable who's
name is stored in $message. For example, if $message contains "var", $$message is the same as $var.



36. How can we get the browser properties using php?

<?php

echo $_SERVER['HTTP_USER_AGENT'] . "nn";

$browser = get_browser(null, true);

print_r($browser);

?>

37. How can we know that a session is started or not?

A session starts by session_start()function.

this session_start() is always declared in header portion.it always declares first.then

we write session_register().

38. What is the use of obj_start()?

Its intializing the object buffer, so that the whole page will be first parsed (instead of parsing in parts and
thrown to browser gradually) and stored in output buffer so that after complete page is executed, it is
thrown to the browser once at a time.

39. What is the difference between Split and Explode?

split()-used for JavaScript for processing the string and the explode()-used to convert the String to Array,
implode()-used for convert the array to String

Here the Example

<?php

$x="PHP is a ServerSide Scripting Language";

$c=explode(" ",$x);

print_r($c);

$d=implode(" ",$c);

echo "
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                  PHP Interview Questions

".$d;

?>



Javascript Example:

list($month, $day, $year) = split('[/.-]', $date);

40. Which will execute faster on php POST or GET?

Both are same while performing the action but using POST security is there.

Because using GET method in the action, form field values send along with URL, so at the time of
sending password, problem will occur means password also will shown in the URL.

Using of POST there is no problem.

GET method has a limit of sending parameters 100 characters but POST method does not have a limit of
sending data

GET is faster than POST. Because GET fetch the data directly from the URL but POST method fetch the
encrypted data from the page.

41. What is the use of sprintf() function?

The sprintf() function writes a formatted string to a variable.

42. What Is a Session?

Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete
functional transaction for the same visitor.

43. What is the use of header() function in php?

The header() function is used for redirect the page.if you want to redirect one page to another we can
use it.

44. How can i get ip address?

REMOTE_ADDR - the IP address of the client

REMOTE_HOST - the host address of the client

45. What is htaccess?

.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a
per-directory basis.
FNT Software Solutions Pvt Ltd, Bangalore
                                                                                  PHP Interview Questions

46. What is the diffrence between Notify URL and Return URL?

Notify URL is used to just notify the status while processing.

Return URL is used to return after processing.



47. What is the difference between ucfirst and ucwords?

ucfirst() to convert the first letter of every string to uppercase, and ucwords(), to convert the first letter
of every word in the string to uppercase.

48. What is meant by nl2br()?

nl2br() inserts a HTML tag <br> before all new line characters n in a string.

49. How To Read the Entire File into a Single String?

<?php

$file = file_get_contents("/windows/system32/drivers/etc/services");

print("Size of the file: ".strlen($file)."n");

?>

50. What are the different functions in sorting an array?

Sorting functions in PHP:

asort()

arsort()

ksort()

krsort()

uksort()

sort()

natsort()

rsort()

Más contenido relacionado

La actualidad más candente

Php Data Objects
Php Data ObjectsPhp Data Objects
Php Data Objectshiren.joshi
 
Symfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 IntegrationSymfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 IntegrationJonathan Wage
 
Python dictionary : past, present, future
Python dictionary: past, present, futurePython dictionary: past, present, future
Python dictionary : past, present, futuredelimitry
 
Difference between mysql_fetch_array and mysql_fetch_assoc in PHP
Difference between mysql_fetch_array and mysql_fetch_assoc in PHPDifference between mysql_fetch_array and mysql_fetch_assoc in PHP
Difference between mysql_fetch_array and mysql_fetch_assoc in PHPVineet Kumar Saini
 
Swift for TensorFlow - CoreML Personalization
Swift for TensorFlow - CoreML PersonalizationSwift for TensorFlow - CoreML Personalization
Swift for TensorFlow - CoreML PersonalizationJacopo Mangiavacchi
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Pythonkwatch
 
엘라스틱서치 적합성 이해하기 20160630
엘라스틱서치 적합성 이해하기 20160630엘라스틱서치 적합성 이해하기 20160630
엘라스틱서치 적합성 이해하기 20160630Yong Joon Moon
 
Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26SynapseindiaComplaints
 
Java script introducation & basics
Java script introducation & basicsJava script introducation & basics
Java script introducation & basicsH K
 
Extending Moose
Extending MooseExtending Moose
Extending Moosesartak
 
Creating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonCreating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonSiddhi
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionKent Huang
 
Chap 3php array part 2
Chap 3php array part 2Chap 3php array part 2
Chap 3php array part 2monikadeshmane
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data ObjectsWez Furlong
 
Zend Framework meets Doctrine 2
Zend Framework meets Doctrine 2Zend Framework meets Doctrine 2
Zend Framework meets Doctrine 2Mayflower GmbH
 

La actualidad más candente (20)

Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
Php Data Objects
Php Data ObjectsPhp Data Objects
Php Data Objects
 
Symfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 IntegrationSymfony2 and Doctrine2 Integration
Symfony2 and Doctrine2 Integration
 
Python dictionary : past, present, future
Python dictionary: past, present, futurePython dictionary: past, present, future
Python dictionary : past, present, future
 
Difference between mysql_fetch_array and mysql_fetch_assoc in PHP
Difference between mysql_fetch_array and mysql_fetch_assoc in PHPDifference between mysql_fetch_array and mysql_fetch_assoc in PHP
Difference between mysql_fetch_array and mysql_fetch_assoc in PHP
 
Swift for TensorFlow - CoreML Personalization
Swift for TensorFlow - CoreML PersonalizationSwift for TensorFlow - CoreML Personalization
Swift for TensorFlow - CoreML Personalization
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Python
 
엘라스틱서치 적합성 이해하기 20160630
엘라스틱서치 적합성 이해하기 20160630엘라스틱서치 적합성 이해하기 20160630
엘라스틱서치 적합성 이해하기 20160630
 
Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26Synapse india complain sharing info about php chaptr 26
Synapse india complain sharing info about php chaptr 26
 
Swing database(mysql)
Swing database(mysql)Swing database(mysql)
Swing database(mysql)
 
Java script introducation & basics
Java script introducation & basicsJava script introducation & basics
Java script introducation & basics
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
Codeware
CodewareCodeware
Codeware
 
Extending Moose
Extending MooseExtending Moose
Extending Moose
 
Creating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonCreating Domain Specific Languages in Python
Creating Domain Specific Languages in Python
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 Function
 
Chap 3php array part 2
Chap 3php array part 2Chap 3php array part 2
Chap 3php array part 2
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data Objects
 
Zend Framework meets Doctrine 2
Zend Framework meets Doctrine 2Zend Framework meets Doctrine 2
Zend Framework meets Doctrine 2
 
lab4_php
lab4_phplab4_php
lab4_php
 

Destacado

30 top my sql interview questions and answers
30 top my sql interview questions and answers30 top my sql interview questions and answers
30 top my sql interview questions and answersskills9tanish
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questionssekar c
 
Mitali_Shukla_B.E._IT_2015.pdf
Mitali_Shukla_B.E._IT_2015.pdfMitali_Shukla_B.E._IT_2015.pdf
Mitali_Shukla_B.E._IT_2015.pdfmitali Shukla
 
Design and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design ToolDesign and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design Tooltalk2harry
 
09.02 normalization example
09.02 normalization example09.02 normalization example
09.02 normalization exampleBishal Ghimire
 
Codeigniter Training Part3
Codeigniter Training Part3Codeigniter Training Part3
Codeigniter Training Part3Weerayut Hongsa
 
PL/SQL Interview Questions
PL/SQL Interview QuestionsPL/SQL Interview Questions
PL/SQL Interview QuestionsSrinimf-Slides
 
Top 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPTop 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPKetan Patel
 
U-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningU-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningMichael Rys
 

Destacado (13)

30 top my sql interview questions and answers
30 top my sql interview questions and answers30 top my sql interview questions and answers
30 top my sql interview questions and answers
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Mitali_Shukla_B.E._IT_2015.pdf
Mitali_Shukla_B.E._IT_2015.pdfMitali_Shukla_B.E._IT_2015.pdf
Mitali_Shukla_B.E._IT_2015.pdf
 
Design and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design ToolDesign and Implementation of Relational Database Design Tool
Design and Implementation of Relational Database Design Tool
 
09.02 normalization example
09.02 normalization example09.02 normalization example
09.02 normalization example
 
Normalization
NormalizationNormalization
Normalization
 
Codeigniter Training Part3
Codeigniter Training Part3Codeigniter Training Part3
Codeigniter Training Part3
 
Good sql server interview_questions
Good sql server interview_questionsGood sql server interview_questions
Good sql server interview_questions
 
Database anomalies
Database anomaliesDatabase anomalies
Database anomalies
 
Sql
SqlSql
Sql
 
PL/SQL Interview Questions
PL/SQL Interview QuestionsPL/SQL Interview Questions
PL/SQL Interview Questions
 
Top 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHPTop 50 Interview Questions and Answers in CakePHP
Top 50 Interview Questions and Answers in CakePHP
 
U-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningU-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance Tuning
 

Similar a Fnt Software Solutions Pvt Ltd Placement Papers - PHP Technology

Php interview questions
Php interview questionsPhp interview questions
Php interview questionsShubham Sunny
 
Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersVineet Kumar Saini
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Tekblink Jeeten
 
Php interview questions with answer
Php interview questions with answerPhp interview questions with answer
Php interview questions with answerSoba Arjun
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answerssheibansari
 
100 PHP question and answer
100 PHP  question and answer100 PHP  question and answer
100 PHP question and answerSandip Murari
 
php&mysql with Ethical Hacking
php&mysql with Ethical Hackingphp&mysql with Ethical Hacking
php&mysql with Ethical HackingBCET
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsJagat Kothari
 
Php and MySQL Web Development
Php and MySQL Web DevelopmentPhp and MySQL Web Development
Php and MySQL Web Developmentw3ondemand
 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For BeginnersPriti Solanki
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolmentRajib Ahmed
 

Similar a Fnt Software Solutions Pvt Ltd Placement Papers - PHP Technology (20)

Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and Answers
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
 
Oss questions
Oss questionsOss questions
Oss questions
 
Php interview questions with answer
Php interview questions with answerPhp interview questions with answer
Php interview questions with answer
 
PHP Reviewer
PHP ReviewerPHP Reviewer
PHP Reviewer
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
lab4_php
lab4_phplab4_php
lab4_php
 
100 PHP question and answer
100 PHP  question and answer100 PHP  question and answer
100 PHP question and answer
 
php&mysql with Ethical Hacking
php&mysql with Ethical Hackingphp&mysql with Ethical Hacking
php&mysql with Ethical Hacking
 
Php
PhpPhp
Php
 
php questions
php questions php questions
php questions
 
Php
PhpPhp
Php
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample Questions
 
PHP
PHPPHP
PHP
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Php and MySQL Web Development
Php and MySQL Web DevelopmentPhp and MySQL Web Development
Php and MySQL Web Development
 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For Beginners
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolment
 
Php
PhpPhp
Php
 

Más de fntsofttech

Fnt software solutions package seo
Fnt software solutions package   seoFnt software solutions package   seo
Fnt software solutions package seofntsofttech
 
FNT Software Solutions Package - SEO
FNT Software Solutions Package - SEOFNT Software Solutions Package - SEO
FNT Software Solutions Package - SEOfntsofttech
 
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP TechnologiesFNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologiesfntsofttech
 
Fnt Software Solutions Pvt Ltd Company Profile
Fnt Software Solutions Pvt Ltd Company ProfileFnt Software Solutions Pvt Ltd Company Profile
Fnt Software Solutions Pvt Ltd Company Profilefntsofttech
 
Fnt software company profile
Fnt software company profileFnt software company profile
Fnt software company profilefntsofttech
 
FNT Software Solutions Pvt Ltd Placement Papers - Android Technology
FNT Software Solutions Pvt Ltd Placement Papers - Android TechnologyFNT Software Solutions Pvt Ltd Placement Papers - Android Technology
FNT Software Solutions Pvt Ltd Placement Papers - Android Technologyfntsofttech
 
FNT Software Solutions Placement Papers - Android
FNT Software Solutions Placement Papers - AndroidFNT Software Solutions Placement Papers - Android
FNT Software Solutions Placement Papers - Androidfntsofttech
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paperfntsofttech
 

Más de fntsofttech (8)

Fnt software solutions package seo
Fnt software solutions package   seoFnt software solutions package   seo
Fnt software solutions package seo
 
FNT Software Solutions Package - SEO
FNT Software Solutions Package - SEOFNT Software Solutions Package - SEO
FNT Software Solutions Package - SEO
 
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP TechnologiesFNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
 
Fnt Software Solutions Pvt Ltd Company Profile
Fnt Software Solutions Pvt Ltd Company ProfileFnt Software Solutions Pvt Ltd Company Profile
Fnt Software Solutions Pvt Ltd Company Profile
 
Fnt software company profile
Fnt software company profileFnt software company profile
Fnt software company profile
 
FNT Software Solutions Pvt Ltd Placement Papers - Android Technology
FNT Software Solutions Pvt Ltd Placement Papers - Android TechnologyFNT Software Solutions Pvt Ltd Placement Papers - Android Technology
FNT Software Solutions Pvt Ltd Placement Papers - Android Technology
 
FNT Software Solutions Placement Papers - Android
FNT Software Solutions Placement Papers - AndroidFNT Software Solutions Placement Papers - Android
FNT Software Solutions Placement Papers - Android
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
 

Último

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Último (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Fnt Software Solutions Pvt Ltd Placement Papers - PHP Technology

  • 1. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions PHP Interview Questions: 1. What's PHP? The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. 2. How can we know the number of days between two given dates using PHP? $date1 = date('Y-m-d'); $date2 = '2006-07-01'; $days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24); echo "Number of days since '2006-07-01': $days"; 3. How do you define a constant? define ("MYCONSTANT", 100); 4. What is meant by urlencode and urldecode? urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of URLs. urldecode() returns the URL decoded version of the given string. 5. How To Get the Uploaded File Information in the Receiving Script? Uploaded file information is organized in $_FILES as a two-dimensional array as: $_FILES[$fieldName]['name'] - The Original file name on the browser system. $_FILES[$fieldName]['type'] - The file type determined by the browser. $_FILES[$fieldName]['size'] - The Number of bytes of the file content. $_FILES[$fieldName]['tmp_name'] - The temporary filename of the file in which the uploaded file was stored on the server. $_FILES[$fieldName]['error'] - The error code associated with this file upload.
  • 2. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions 6. What is the difference between mysql_fetch_object and mysql_fetch_array? MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array 7. How do you pass a variable by value? Just like in C++, put an ampersand in front of it, like $a = &$b. 8. How can we send mail using JavaScript? No. There is no way to send emails directly using JavaScript. But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example: function myfunction(form) { tdata=document.myform.tbox1.value; location="mailto:mailid@domain.com?subject=..."; return true; } 9. What is the difference between ereg_replace() and eregi_replace()? eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters. 10. How do I find out the number of parameters passed into function ? func_num_args() function returns the number of parameters passed in. 11. Are objects passed by value or by reference? Everything is passed by value. 12. What are the differences between DROP a table and TRUNCATE a table? DROP TABLE table_name - This will delete the table and its data. TRUNCATE TABLE table_name - This will delete the data of the table, but not the table definition.
  • 3. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions 13. How do you call a constructor for a parent class? parent::constructor($value) 14. How can we submit a form without a submit button? If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link. <a href="javascript: document.myform.submit();">Submit Me</a> 15. How can we extract string 'abc.com ' from a string http://info@abc.com using regular expression of php? We can use the preg_match() function with "/.*@(.*)$/" as the regular expression pattern. For example: preg_match("/.*@(.*)$/","http://info@abc.com",$data); echo $data[1]; 16. What is the difference between the functions unlink and unset? unlink() is a function for file system handling. It will simply delete the file in context. unset() is a function for variable management. It will make a variable undefined. 17. What is the difference between characters 047 and x47? The first one is octal 47, the second is hex 47. 18. How can we create a database using PHP and mysql? We can create MySQL database with the use of mysql_create_db($databaseName) to create a database. 19. How can we destroy the session, how can we unset the variable of a session? session_unregister() - Unregister a global variable from the current session session_unset() - Free all session variables 20. How can we know the count/number of elements of an array? a) sizeof($array) - This function is an alias of count()
  • 4. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions b) count($urarray) - This function returns the number of elements in an array. Interestingly if you just pass a simple var instead of an array, count() will return 1 21. How many values can the SET function of MySQL take? MySQL SET function can take zero or more values, but at the maximum it can take 64 values. 22. What are the other commands to know the structure of a table using MySQL commands except EXPLAIN command? DESCRIBE table_name; 23. How can we find the number of rows in a table using MySQL? SELECT COUNT(*) FROM table_name; 24. How can we find the number of rows in a result set using PHP? $result = mysql_query($any_valid_sql, $database_link); $num_rows = mysql_num_rows($result); echo "$num_rows rows found"; 25. What is the difference between CHAR and VARCHAR data types? CHAR is a fixed length data type. CHAR(n) will take n characters of storage even if you enter less than n characters to that column. For example, "Hello!" will be stored as "Hello! " in CHAR(10) column. VARCHAR is a variable length data type. VARCHAR(n) will take only the required storage for the actual number of characters entered to that column. For example, "Hello!" will be stored as "Hello!" in VARCHAR(10) column. 26. What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()? mysql_fetch_array - Fetch a result row as an associative array and a numeric array. mysql_fetch_object - Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows mysql_fetch_row() - Fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.
  • 5. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions 27. What is the difference between htmlentities() and htmlspecialchars()? htmlspecialchars() - Convert some special characters to HTML entities (Only the most widely used) htmlentities() - Convert ALL special characters to HTML entities 28. How can we get the properties (size, type, width, height) of an image using php image functions? image size use getimagesize() function image width use imagesx() function image height use imagesy() function 29. How can we increase the execution time of a php script? By the use of void set_time_limit(int seconds) 30. What are the difference between abstract class and interface? Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class. Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class. 31. What is the maximum size of a file that can be uploaded using PHP and how can we change this? change maximum size of a file set upload_max_filesize variable in php.ini file 32. Explain the ternary conditional operator in PHP? Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. 33. What’s the difference between include and require? It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue. 34. How many ways can we get the value of current session id? session_id() returns the session id for the current session. 35. What is the difference between $message and $$message?
  • 6. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions They are both variables. But $message is a variable with a fixed name. $$message is a variable who's name is stored in $message. For example, if $message contains "var", $$message is the same as $var. 36. How can we get the browser properties using php? <?php echo $_SERVER['HTTP_USER_AGENT'] . "nn"; $browser = get_browser(null, true); print_r($browser); ?> 37. How can we know that a session is started or not? A session starts by session_start()function. this session_start() is always declared in header portion.it always declares first.then we write session_register(). 38. What is the use of obj_start()? Its intializing the object buffer, so that the whole page will be first parsed (instead of parsing in parts and thrown to browser gradually) and stored in output buffer so that after complete page is executed, it is thrown to the browser once at a time. 39. What is the difference between Split and Explode? split()-used for JavaScript for processing the string and the explode()-used to convert the String to Array, implode()-used for convert the array to String Here the Example <?php $x="PHP is a ServerSide Scripting Language"; $c=explode(" ",$x); print_r($c); $d=implode(" ",$c); echo "
  • 7. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions ".$d; ?> Javascript Example: list($month, $day, $year) = split('[/.-]', $date); 40. Which will execute faster on php POST or GET? Both are same while performing the action but using POST security is there. Because using GET method in the action, form field values send along with URL, so at the time of sending password, problem will occur means password also will shown in the URL. Using of POST there is no problem. GET method has a limit of sending parameters 100 characters but POST method does not have a limit of sending data GET is faster than POST. Because GET fetch the data directly from the URL but POST method fetch the encrypted data from the page. 41. What is the use of sprintf() function? The sprintf() function writes a formatted string to a variable. 42. What Is a Session? Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor. 43. What is the use of header() function in php? The header() function is used for redirect the page.if you want to redirect one page to another we can use it. 44. How can i get ip address? REMOTE_ADDR - the IP address of the client REMOTE_HOST - the host address of the client 45. What is htaccess? .htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis.
  • 8. FNT Software Solutions Pvt Ltd, Bangalore PHP Interview Questions 46. What is the diffrence between Notify URL and Return URL? Notify URL is used to just notify the status while processing. Return URL is used to return after processing. 47. What is the difference between ucfirst and ucwords? ucfirst() to convert the first letter of every string to uppercase, and ucwords(), to convert the first letter of every word in the string to uppercase. 48. What is meant by nl2br()? nl2br() inserts a HTML tag <br> before all new line characters n in a string. 49. How To Read the Entire File into a Single String? <?php $file = file_get_contents("/windows/system32/drivers/etc/services"); print("Size of the file: ".strlen($file)."n"); ?> 50. What are the different functions in sorting an array? Sorting functions in PHP: asort() arsort() ksort() krsort() uksort() sort() natsort() rsort()