AWS Training Online Course - Best AWS Certification - Intellipaat

AWS Training Online Course - Best AWS Certification - Intellipaat

Enroll for best AWS training course with AWS Certification online and placement support. Learn Amazon web services AWS course from certified AWS experts. Enroll Now!

Enroll for best AWS training course with AWS Certification online and placement support. Learn Amazon web services AWS course from certified AWS experts. Enroll Now!

Amazon Web Services Tutorial – Learn Amazon Web Services from Experts

Amazon Web Services Tutorial – Learn Amazon Web Services from Experts

This AWS tutorial is meant for beginners to learn AWS. Through this AWS tutorial you will understand AWS architecture, various AWS products like S3, EC2, VPC, Route 53, Lambda, IAM, Redshift, RDS, DynamoDB and others. You will know the advantages of AWS, migration from on-premise to AWS cloud, administration of AWS and more through this easy to learn AWS tutorial. If you want to master AWS and get certified then check the Intellipaat AWS training course.

What is AWS?

First of all, what does AWS stand for? Obviously it is Amazon Web Services. Amazon Web Services is the world’s biggest cloud provider which is owned by Amazon. They provide a set of on-demand services to the customers via the internet or “The Cloud”. Also, you get a pay-as-you-go option where you need to only pay for what you use. AWS lets you work and run applications on the virtual machine like your own computer.

Watch this AWS Certification full course for Beginners video



To be very simple, AWS provides their services over the internet which is actually installed in their infrastructure.

Market share and Popularity

AWS cloud has 41% market share in the cloud industry. Azure is the next major cloud provider and it lacks behind with only 29% of the market. So, AWS leads way ahead.

AWS is the most popular cloud provider in the world and it is the most used in USA and India too. 

So, what makes AWS so special? Let’s take a look.

Learn more about AWS in this insightful AWS blog!

AWS Well-Architected Framework

The Well-Architected Framework has been designed and developed in a way that it could help cloud architects build secure, reliable, high-performing, and efficient infrastructure for their applications. The 5 pillars of AWS is used to provide a consistent approach for customers and clients to design, evaluate, and implement prototypes that will work perfectly for them in the long-run.

Go through the AWS Course in London to get clear understanding of AWS.

5 pillars of AWS

While creating an infrastructure in AWS, you can never afford to miss these 5 points which we will be seeing now. These instructions are provided by AWS itself.

  • Operational Excellence
  • Security
  • Reliability
  • Performance Efficiency
  • Cost Optimization

Operational Excellence:

The pillar includes the ability to run and monitor systems to deliver amazing business value and to improve exponentially in supporting processes and procedures.

To achieve operational excellence, there are 6 design principles to follow and they are:

  • Perform operations as code
  • Annotate documentation
  • Make frequent, small, reversible changes
  • Refine operations procedures frequently
  • Anticipate failure
  • Learn from all operational failures

Learn more about AWS in this AWS training in New York to get ahead in your career!

Security:

Security pillar has the ability to secure and protect the data and applications stored in the cloud and also to provide business value by having contingency plans, risk assessments, and migration strategies.

If you have any doubts or Queries related to AWS, get it clarifies from AWS Experts on AWS Community.

To achieve a secure architecture in the cloud, follow these design principles:

  • Implement a strong identity foundation
  • Enable traceability
  • Apply security at all layers
  • Automate security best practices
  • Protect data in transit and at rest
  • Prepare for security events

Interested in learning AWS? Click here to learn more in this AWS Training in Sydney!

Reliability:

This pillar includes the ability of the system to recover from a service or infrastructure destruction. Also, how fast it recovers from it.

The principles provided are:

  • Test recovery procedures
  • Automatically recover from failure
  • Scale horizontally to increase aggregate system availability
  • Stop guessing capacity
  • Manage change in automation

Performance Efficiency:

The ability to use computing resources efficiently so that they meet the demanded requirements is what this pillar talks about.

The design principles for this pillar are:

  • Democratize advanced technologies
  • Go global in minutes
  • Use serverless architectures
  • Experiment more often
  • Mechanical sympathy

Become Master of AWS by going through this online AWS course in Toronto.

Cost Optimization:

Minimizing the costs or avoiding them by getting rid of unwanted resources and cleverly designing an architecture which does cut costs.

The principles to be remembered are:

  • Adopt a consumption model
  • Measure overall efficiency
  • Stop spending money on data centre operations
  • Analyze and attribute expenditure
  • Use managed services to reduce the cost of ownership

When building an AWS architecture remember all these key pillars to create an effective architecture.

Get certified from top AWS course in Singapore Now

Services provided by AWS

We already saw what is AWS and it’s popularity. Now, let us see the services which made AWS what it is today. AWS offers a variety of services that can be categorized in the following categories:

  • Compute and Networking Services
  • Amazon EC2 – Amazon Simple Notification Service (SNS) is a messaging service. Amazon Simple Email Service is a email sending service via cloud.
  • Amazon VPC – Amazon VPC is one that provides an additional layer of security for all AWS services that you use.
  • AWS Elastic Beanstalk – AWS Elastic Beanstalk is a compute service which makes it easier for the developers to quickly deploy and manage applications which you upload to the AWS cloud.
  • Amazon ELB – Load balancer is a service which uniformly distributes network traffic and workloads across multiple servers or cluster of servers.
  • Storage and Content Delivery Services
  • Amazon S3 – Amazon Simple Storage Service (S3) is a storage that can be maintained and accessed over the Internet.
  • Amazon CloudFront – It is a Content Delivery Network (CDN) which delivers apps, videos, and other data in low latency to the customers.
  • Security and Identity Services
  • Amazon Cognito – Allows sign-in, sign-up and provides access to your mobile and web apps.
  • AWS IAM – AWS Identity and Access Management enables you to manage access to AWS services and resources securely
  • Database Services
  • Amazon RDS – Amazon RDS is a service which provides database connectivity through the internet. RDS makes it very simple, easy and set up a relational database through the cloud.
  • Amazon Redshift – Amazon Redshift is a data warehouse service which is fully managed by AWS.
  • Amazon Aurora – AWS Aurora is a relational database engine which provides the simplicity and cost-effectiveness of an open source database combined with the power, performance, and reliability of a high-end commercial database.

Watch this AWS S3 video by Intellipaat:

  • Analytics Services
  • Amazon Kinesis – For real-time analytics, Amazon Kinesis makes it easy to collect, process and analyze streaming data such as IoT telemetry data, application logs, and website clickstreams.
  • Amazon QuickSight – Fast, cloud-powered business analytics service, that that makes it easy to build stunning visualizations and rich dashboards that can be accessed from any browser or mobile device.
  • Application Services
  • Amazon SES – Amazon Simple Email Service is a email sending service via cloud. This is mainly developed for marketers and developers to send business and transactional emails.
  • Amazon SNS – Amazon Simple Notification Service (SNS) is a messaging service. SNS is highly available, durable, secure, and fully management publisher/subscriber service.
  • Management Tools
  • AWS Management Console – AWS Management Console is basically a web application that allows users to access and manage any of the resources/services running on the AWS infrastructure.
  • AWS CloudWatch – Amazon CloudWatch is AWS monitoring and management service which is designed for the purpose of maintaining the services and resources which are used.

The most used services are Compute, Storage and Security. Most of the businesses who opt for Cloud start with storage, that is migrating their data to the cloud.

Who uses AWS?

World’s biggest companies in their own domain use AWS for their cloud needs.

The number of active users of AWS exceeds 1,000,000. 10% of that users are Enterprise-scale users and the rest of it is covered by small and mid-sized companies.

The firms which have gone “all-in” that is removing their data centres and completely opting for AWS. Netflix went all-in in the year 2015, and they use a huge amount of resources from AWS. Hertz and Time incorporation are two other companies who went all-in.

Tata Motors and Wipro are the two of the biggest Indian MNCs to use AWS. 

Learn Complete AWS at Hyderabad in 24 Hrs.

Why businesses prefer AWS?

It is mainly because of all the cloud computing advantages but what does AWS have that is better than other providers like Azure and GCP. 

AWS started their cloud business in 2006 which was way before any other major company even thought of it. They have failed a lot and have gained experience from it, and right now they are the leaders because of it. They provide an overwhelming amount of services which can be used by many businesses to their advantage.

The Brand name they created by the success of Amazon.com is one of the main reason businesses trust AWS. Also, anybody could easily set up a profile and start with AWS.

Are you interested in learning AWS course in Bangalore from Experts?

Starting off with AWS

It is very simple to start off with AWS. There is no complex procedures to start. Let me give you the steps to easily create a AWS account and access the AWS management console.

Step 1: Create an AWS account by providing personal and credit/debit card details. INR 2 will be deducted to validate your card.

Step 2: Choose the plan you want. Basic, Developer, or Business plan. Basic is free for 12 months with limits. Developer costs 29$/month and Business costs 100$/month.

Step 3: Now you will get access to the AWS Mangement Console. You just have to learn how to use the services. For detailed information on Creating a account and the AWS Management Console click here.

Here ends this AWS Tutorial on Amazon Web Services. Wish to learn more? Check out Intellipaat’s AWS Courseto get an in-depth understanding of Amazon Web Services!

Table of Content

Definition of Cloud computing

What is Cloud Computing?

AWS is one of vendors of cloud services, which is why is becomes imperative to have a clear understanding of cloud computing. Cloud Computing is generally referred to as 'Cloud'. Cloud delivers the resources and services on a virtual platform on-demand in a pay-as-you-go manner. These resources and services can be anything ranging from applications to data Read More

Advantages And Disadvantages of Cloud Computing

Pros and Cons of Cloud Computing

Cloud Computing is shaping how we live and work today. Like it or not, it has become an integral part of our lives. Companies and businesses of all shapes and sizes are now turning to cloud Computing. But nothing is perfect and Cloud Computing is no exception. While it is vastly beneficial, it also Read More

Global Infrastructure

Global Infrastructure of AWS

AWS spreads its services around the world and has a million dynamic clients. The global infrastructure of AWS is broadening so that the clients or end users capable to get the result of higher throughput and lower latency and also to make sure that the client’s data remains in their desired space or region they specify. Read More

AWS Introduction

What is AWS?

Amazon Web Services (AWS) can be defined as the huge set of on-demand services provided to the customers on cloud with pay-as-you-go pricing method. Whether it is about configuring a server or running an application, AWS lets you execute your operations on cloud in a similar way as you would do on a physical computer. You can Read More

AWS Security

Security in AWS

Security is the most prior thing in AWS. The advantage of using the AWS service is that, you can reach the requirements of the most security-sensitive organization from data center and network architecture. If your desire is to maintain secure environments then clients can go to AWS cloud and also it permits clients to scale and innovate. Read More

AWS Compliance

AWS Compliance Overview

AWS makes clients to identify the vigorous controls in place with the aid of Cloud Compliance at AWS at data safety and sustain security in the cloud. The compliance responsibilities will get exchanged since the systems are created on top of AWS cloud infrastructure. Through tying mutually governance-targeted, audit-pleasant service characteristics with appropriate compliance or audit standards, Read More

Amazon Web Services Cloud Platform

AWS Cloud Platform

It is essential to have a wide variety of technologies, so that it is possible to develop, operate and manage our applications. The AWS comprises a several cloud services, they can be well suited to your business or to your organizational needs. The services can be extracted from the AWS management Console and Command Line Interface. Watch Read More

Compute

AWS Computation

Amazon EC2: This is a web service, have a feature of resizable compute in the cloud. It makes easy for developers in the process of web-scale computing. This provides an interface and with that we can get configure capacity by minimum resistance. We will be able to hold the entire control on our own computing resources and also, Read More

Storage and Content Delivery

Storage requirements

What is Amazon S3 Overview video [videothumb class="col-md-12" id="CvWoj1EBrTA" alt="What is Amazon S3 Overview" title="What is Amazon S3 Overview"] Amazon Web Services suggests a wide variety of services to reach the storage requirements. Key services Key concepts Usage scenarios Documentation Key services Key services Description Amazon S3 With this component one can retrieve the input data sets which Read More

Database

Database management system in AWS

The developers offered a several database management services from AWS. The there are numerous options you can find to run, managed relational data and also managed NoSQL databases, or there is one more option to run the code on online platform in the cloud on Amazon EBS and Amazon EC2. Amazon RDS : A known web Read More

Networking

AWS Networking

The networking services offered by AWS are immense. We can set up the internet route by joining IP addresses, setting up of the logical servers according to the transmission protocols. The networking services can be used on applications like: Key services Key concepts Architecture Documentation Want more? Here is an awesome AWS VPC video for your reference, which Read More

Developer Tools

AWS Development Tools Overview

Applications of AWS are used by developer tools brilliantly. Tools used by the developers are as below: AWS Management Console : It manages the quickly growing Amazon architecture.It controls your calculation, storing and also some cloud based activities using a very simple graphical border. AWS Toolkit for Eclipse : It is a tool for using Java Read More

Management Tools

Popular management tools offered by AWS

In this chapter we will be discussing about the various management tools offered by AWS. Amazon CloudWatch It monitors the tune-ups used in the cloud and also other functions on the Amazon web services. It is used for metrics following controlling logging files and also keeping alerts. Instances, Database tables, metrics are all controlled Read More

Security And Identity

AWS Security and Identity Overview

The safety concern offered by this AWS enables us to have a safer data storage in the cloud network. Safety services of AWS include AWS Identity and Access Management which uses terms and conditions to allow the entry of the users into the AWS assets. Another safety measure is the AWS Directory Service which allows Read More

Analytics

AWS Analytics Overview

The services provided by the analytical tools of AWS are as follows: The data are organized and controlled by the Amazon Elastic MapReduce with the assistance of the Hadoop technology sharing deals.This tool very simply sets up and manages the Hadoop framework. This tool controls the calculative assets and carries on the MapReduce process. The flowing of Read More

Internet Of Things

AWS Internet of things

The AWS IoT acts as the mediator between the components and the network. It hence, gathers information from those things and works on them. AWS IoT is defined as a platform which enables you to connect devices to AWS Services along with the other devices, secure data and interactions, process and act upon device data, and Read More

Mobile Services

Amazon Cognito

finds out ways to recognize sole users, recover provisional ,unimportant passwords and helps in information management operations. To initiate with Cognito, the steps are: Register in AWS. Get the token of your application. Develop an identity pool for Cognito. Develop SDK , accumulate and then synchronize the information. Learn more about AWS in this insightful AWS Read More

AWS Cheat Sheet

AWS Quick Reference Guide

If you are looking for a flexible and low cost IT resource, then you must take AWS into consideration. This AWS cheat sheet covers the services offered by Amazon, common use cases and technical limitations. This is a handy reference to the one who is willing to work on cloud services which provides all the basic Read More

AWS Lambda Tutorial

Introduction

In this tutorial, we will discuss Amazon’s very reliable serverless computing service AWS Lambda. Before starting this tutorial, we’re assuming that you’ve already worked on AWS cloud and you’ve knowledge of AWS compute and database services. We will dive you into the main concepts of AWS Lambda by understanding why we need this service, what is this service, its Read More

Originally published at www.intellipaat.com on May 16, 2016.

PHP Interview Questions - Top 50 Questions for PHP Developers

PHP Interview Questions - Top 50 Questions for PHP Developers

In this article, you'll see top 50 PHP interview questions from basic to advanced that you must know in 2019

PHP is a recursive acronym for PHP Hypertext Preprocessor. It is a widely used open-source programming language especially suited for creating dynamic websites and mobile API’s. So, if you are planning to start your career in PHP and you wish to know the skills related to it, now is the right time to dive in. These **PHP Interview Questions and Answers **are collected after consulting with **PHP Certification Training **experts.

The PHP Interview Questions are divided into 2 sections:
Basic Level PHP Interview QuestionsAdvanced Level PHP Interview Questions
Let’s begin with the first section of PHP interview questions.

Basic Level PHP Interview Questions

Q1. What are the common uses of PHP?

Q2. What is PEAR in PHP?

PEAR is a framework and repository for reusable PHP components. PEAR stands for PHP Extension and Application Repository. It contains all types of PHP code snippets and libraries. It also provides a command line interface to install “packages” automatically.

Q3. What is the difference between static and dynamic websites?

Q4. How to execute a PHP script from the command line?

To execute a PHP script, use the PHP Command Line Interface (CLI) and specify the file name of the script in the following way:

php script.php

Q5. Is PHP a case sensitive language?

PHP is partially case sensitive. The variable names are case-sensitive but function names are not. If you define the function name in lowercase and call them in uppercase, it will still work. User-defined functions are not case sensitive but the rest of the language is case-sensitive.

Q6. What is the meaning of ‘escaping to PHP’?

The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. The mechanism for doing so is known as ‘escaping to PHP’. Escaping a string means to reduce ambiguity in quotes used in that string.

Q7. What are the characteristics of PHP variables?

Some of the important characteristics of PHP variables include:
All variables in PHP are denoted with a leading dollar sign ($).The value of a variable is the value of its most recent assignment.Variables are assigned with the = operator, with the variable on the left-hand side and the expression to be evaluated on the right.Variables can, but do not need, to be declared before assignment.Variables in PHP do not have intrinsic types – a variable does not know in advance whether it will be used to store a number or a string of characters.Variables used before they are assigned have default values.### Q8. What are the different types of PHP variables?

There are 8 data types in PHP which are used to construct the variables:
Integers − are whole numbers, without a decimal point, like 4195.Doubles − are floating-point numbers, like 3.14159 or 49.1.Booleans − have only two possible values either true or false.NULL − is a special type that only has one value: NULL.Strings − are sequences of characters, like ‘PHP supports string operations.’Arrays − are named and indexed collections of other values.Objects − are instances of programmer-defined classes, which can package up both other kinds of values and functions that are specific to the class.Resources − are special variables that hold references to resources external to PHP.### Q9. What are the rules for naming a PHP variable?

The following rules are needed to be followed while naming a PHP variable:
Variable names must begin with a letter or underscore character.A variable name can consist of numbers, letters, underscores but you cannot use characters like + , – , % , ( , ) . & , etc.### Q10. What are the rules to determine the “truth” of any value which is not already of the Boolean type?

The rules to determine the “truth” of any value which is not already of the Boolean type are:
If the value is a number, it is false if exactly equal to zero and true otherwise.If the value is a string, it is false if the string is empty (has zero characters) or is the string “0”, and is true otherwise.Values of type NULL are always false.If the value is an array, it is false if it contains no other values, and it is true otherwise. For an object, containing a value means having a member variable that has been assigned a value.Valid resources are true (although some functions that return resources when they are successful will return FALSE when unsuccessful).Don’t use double as Booleans.### Q11. What is NULL?

NULL is a special data type which can have only one value. A variable of data type NULL is a variable that has no value assigned to it. It can be assigned as follows:

$var = NULL;

The special constant NULL is capitalized by convention but actually it is case insensitive. So,you can also write it as :

$var = null;

A variable that has been assigned the NULL value, consists of the following properties:
It evaluates to FALSE in a Boolean context.It returns FALSE when tested with IsSet() function.### Q12. How do you define a constant in PHP?

To define a constant you have to use define() function and to retrieve the value of a constant, you have to simply specifying its name.If you have defined a constant, it can never be changed or undefined. There is no need to have a constant with a $. A valid constant name starts with a letter or underscore.

Q13. What is the purpose of constant() function?

The constant() function will return the value of the constant. This is useful when you want to retrieve value of a constant, but you do not know its name, i.e., it is stored in a variable or returned by a function. For example –

<?php
define("MINSIZE", 50);
echo MINSIZE;
echo constant("MINSIZE"); // same thing as the previous line
?>

Q14. What are the differences between PHP constants and variables?

Q15. Name some of the constants in PHP and their purpose.

  1. LINE – It represents the current line number of the file.
  2. ** FILE** – It represents the full path and filename of the file. If used inside an include,the name of the included file is returned.
  3. FUNCTION – It represents the function name.
  4. CLASS – It returns the class name as it was declared.
  5. METHOD – It represents the class method name.

Q16. What is the purpose of break and continue statement?

Break – It terminates the for loop or switch statement and transfers execution to the statement immediately following the for loop or switch.

Continue – It causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.

Q17. What are the two most common ways to start and finish a PHP block of code?

The two most common ways to start and** finish** a PHP block of code are:

<?php [ --- PHP code---- ] ?>

<? [--- PHP code ---] ?>

Q18. What is the difference between PHP4 and PHP5?

Q19. What is the meaning of a final class and a final method?

The **final **keyword in a method declaration indicates that the method cannot be overridden by subclasses. A class that is declared final cannot be subclassed. This is particularly useful when we are creating an immutable class like the String class.Properties cannot be declared final, only classes and methods may be declared as final.

Q20. How can you compare objects in PHP?

We use the operator ‘==’ to test if two objects are** instanced** from the same class and have same attributes and equal values. We can also test if two objects are referring to the same instance of the same class by the use of the identity operator ‘===’.

Q21. How can PHP and Javascript interact?

PHP and Javascript cannot directly interact since PHP is a server side language and Javascript is a client-side language. However, we can exchange variables since PHP can generate Javascript code to be executed by the browser and it is possible to pass specific variables back to PHP via the URL.

Q22. How can PHP and HTML interact?

It is possible to generate HTML through PHP scripts, and it is possible to pass pieces of information from HTML to PHP. PHP is a server side language and HTML is a client side language so PHP executes on server side and gets its results as strings, arrays, objects and then we use them to display its values in HTML.

Q23. Name some of the popular frameworks in PHP.

Some of the popular frameworks in PHP are:

  • CakePHP
  • CodeIgniter
  • Yii 2
  • Symfony
  • Zend Framework

Q24. What are the data types in PHP?

PHP support 9 primitive data types:

Q25. What are constructor and destructor in PHP?

PHP constructor and destructor are special type functions which are automatically called when a PHP class object is created and destroyed. The constructor is the most useful of the two because it allows you to send parameters along when creating a new object, which can then be used to initialize variables on the object.

Here is an example of constructor and destructor in PHP:

<?php
class Foo {
 
private $name;
private $link;
 
public function __construct($name) {
$this->;name = $name;
}
 
public function setLink(Foo $link){
$this->;link = $link;
}
 
public function __destruct() {
echo 'Destroying: ', $this->name, PHP_EOL;
}
}
?>

Q26. What are include() and require() functions?

The Include() function is used to put data of one PHP file into another PHP file. If errors occur then the include() function produces a warning but does not stop the execution of the script and it will continue to execute.

The Require() function is also used to put data of one PHP file to another PHP file. If there are any errors then the require() function produces a warning and a fatal error and stops the execution of the script.

Q27. What is the main difference between require() and require_once()?

The require() includes and evaluates a specific file, while require_once() does that only if it has not been included before. The require_once() statement can be used to include a php file in another one, when you may need to include the called file more than once. So, require_once() is recommended to use when you want to include a file where you have a lot of functions.

Q28. What are different types of errors available in Php ?

The different types of error in PHP are:
E_ERROR– A fatal error that causes script termination.E_WARNING– Run-time warning that does not cause script termination.E_PARSE– Compile time parse error.E_NOTICE– Run time notice caused due to error in code.E_CORE_ERROR– Fatal errors that occur during PHP initial startup.E_CORE_WARNING– Warnings that occur during PHP initial startup.E_COMPILE_ERROR– Fatal compile-time errors indication problem with script.E_USER_ERROR– User-generated error message.E_USER_WARNING– User-generated warning message.E_USER_NOTICE- User-generated notice message.E_STRICT– Run-time notices.E_RECOVERABLE_ERROR– Catchable fatal error indicating a dangerous errorE_ALL– Catches all errors and warnings.### Q29. Explain the syntax for ‘foreach’ loop with example.

The foreach statement is used to loop through arrays. For each pass the value of the current array element is assigned to $value and the array pointer is moved by one and in the next pass next element will be processed.

Syntax-

foreach (array as value)
 {
 code to be executed;
 }

Example

<?php
$colors = array("blue", "white", "black");
 
foreach ($colors as $value) {
echo "$value <br>";
}
?>

Q30. What are the different types of Array in PHP?

There are 3 types of Arrays in PHP:
Indexed Array – An array with a numeric index is known as the indexed array. Values are stored and accessed in linear fashion.Associative Array – An array with strings as index is known as the associative array. This stores element values in association with key values rather than in a strict linear index order.Multidimensional Array – An array containing one or more arrays is known as multidimensional array. The values are accessed using multiple indices.### Q31. What is the difference between single quoted string and double quoted string?

Singly quoted strings are treated almost literally, whereas doubly quoted strings replace variables with their values as well as specially interpreting certain character sequences. For example

<?php
$variable = "name";
$statement = 'My $variable will not print!n';
print($statement);
print "<br/>;"
$statement = "My $variable will print!n"
print($statement);
?>

It will give the following output

My $variable will not print!

My name will print

Q32. How to concatenate two strings in PHP?

To concatenate two string variables together, we use the dot (.) operator.

<?php
$string1="Hello edureka";
$string2="123";
echo $string1 . " " . $string2;
?>

This will produce following result

Hello edureka 123

Q33. How is it possible to set an infinite execution time for PHP script?

The set_time_limit(0) added at the beginning of a script sets to infinite the time of execution to not have the PHP error ‘maximum execution time exceeded.’ It is also possible to specify this in the php.ini file.

Q34. What is the difference between “echo” and “print” in PHP?

PHP echo output one or more string. It is a language construct not a function. So use of parentheses is not required. But if you want to pass more than one parameter to echo, use of parentheses is required. Whereas, PHP print output a string. It is a language construct not a function. So use of parentheses is not required with the argument list. Unlike echo, it always returns 1.Echo can output one or more string but print can only output one string and always returns 1.Echo is faster than print because it does not return any value.### Q35. Name some of the functions in PHP.

Some of the functions in PHP include:
ereg() – The ereg() function searches a string specified by string for a string specified by pattern, returning true if the pattern is found, and false otherwise.ereg() – The ereg() function searches a string specified by string for a string specified by pattern, returning true if the pattern is found, and false otherwise.split() – The split() function will divide a string into various elements, the boundaries of each element based on the occurrence of pattern in string.preg_match() – The preg_match() function searches string for pattern, returning true if pattern exists, and false otherwise.preg_split() – The preg_split() function operates exactly like split(), except that regular expressions are accepted as input parameters for pattern.
These were some of the most commonly asked basic level PHP interview questions. Let’s move on to the next section of advanced level PHP interview questions.

Advanced level PHP Interview Questions

Q36. What is the main difference between asp net and PHP?

PHP is a programming language whereas ASP.NET is a programming** framework**. Websites developed by ASP.NET may use C#, but also other languages such as J#. ASP.NET is compiled whereas PHP is interpreted. ASP.NET is designed for windows machines, whereas PHP is platform free and typically runs on Linux servers.

Q37. What is the use of session and cookies in PHP?

A session is a global variable stored on the server. Each session is assigned a unique id which is used to retrieve stored values. Sessions have the capacity to store relatively large data compared to cookies. The session values are automatically deleted when the browser is closed.

Following example shows how to** create a cookie** in PHP

<?php
$cookie_value = "edureka";
setcookie("edureka", $cookie_value, time()+3600, "/your_usename/", "edureka.co", 1, 1);
if (isset($_COOKIE['cookie']))
echo $_COOKIE["edureka"];
?>

Following example shows how to start a session in PHP

<?php
session_start();
 
if( isset( $_SESSION['counter'] ) ) {
$_SESSION['counter'] += 1;
}else {
$_SESSION['counter'] = 1;
}
 
$msg = "You have visited this page". $_SESSION['counter'];
$msg .= "in this session.";
?>

Q38. What is overloading and overriding in PHP?

Overloading is defining functions that have similar signatures, yet have different parameters. Overriding is only pertinent to derived classes, where the parent class has defined a method and the derived class wishes to override that method. In PHP, you can only overload methods using the magic method __call.

Q40. What is the difference between $message and $$message in PHP?

They are both variables. But $message is a variable with a fixed name. $$message is a variable whose name is stored in $message. For example, if $message contains “var”, $$message is the same as $var.

Q41. How can we create a database using PHP and MySQL?

The basic steps to create MySQL database using PHP are:
Establish a connection to MySQL server from your PHP script.If the connection is successful, write a SQL query to create a database and store it in a string variable.Execute the query.### Q42. What is GET and POST method in PHP?

The GET method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character. For example

http://www.test.com/index.htm?name1=value1&name2=value2

The POST method transfers information via HTTP headers. The information is encoded as described in case of GET method and put into a header called QUERY_STRING.

Q43. What is the difference between GET and POST method?

Q44. What is the use of callback in PHP?

PHP callback are functions that may be called dynamically by PHP. They are used by native functions such as array_map, usort, preg_replace_callback, etc. A callback function is a function that you create yourself, then pass to another function as an argument. Once it has access to your callback function, the receiving function can then call it whenever it needs to.

Here is a basic example of callback function

<?php
 
function thisFuncTakesACallback($callbackFunc)
{
echo "I'm going to call $callbackFunc!<br />";
$callbackFunc();
}
function thisFuncGetsCalled()
{
echo "I'm a callback function!<br />";
}
 
thisFuncTakesACallback( 'thisFuncGetsCalled' );
?>

Q45. What is a lambda function in PHP?

A lambda function is an anonymous PHP function that can be stored in a variable and passed as an argument to other functions or methods. A closure is a lambda function that is aware of its surrounding context. For example

$input = array(1, 2, 3, 4, 5);
$output = array_filter($input, function ($v) { return $v > 2; });

unction ($v) { return $v > 2; } is the lambda function definition. We can store it in a variable so that it can be reusable.

Q46. What are PHP Magic Methods/Functions?

In PHP all functions starting with __ names are magical functions/methods. These methods, identified by a two underscore prefix (__), function as interceptors that are automatically called when certain conditions are met. PHP provides a number of ‘magicmethods that allow you to do some pretty neat tricks in object oriented programming.

Here are list of** Magic Functions** available in PHP

Q47. How can you encrypt password using PHP?

The crypt () function is used to create one way encryption. It takes one input string and one optional parameter. The function is defined as: crypt (inputstring, salt), where inputstring consists of the string that has to be encrypted and salt is an optional parameter. PHP uses DES for encryption. The format is as follows:

<?php
$password = crypt('edureka');
print $password. "is the encrypted version of edureka";
?>

Q48. How to connect to a URL in PHP?

PHP provides a library called cURL that may already be included in the installation of PHP by default. cURL stands for client URL, and it allows you to connect to a URL and retrieve information from that page such as the HTML content of the page, the HTTP headers and their associated data.

Q49. What is Type hinting in PHP?

Type hinting is used to specify the expected data type of an argument in a function declaration. When you call the function, PHP will check whether or not the arguments are of the specified type. If not, the run-time will raise an error and execution will be halted.

Here is an example of type hinting

<?php
function sendEmail (Email $email)
{
$email->send();
}
?>

The example shows how to send Email function argument $email Type hinted of Email Class. It means to call this function you must have to pass an email object otherwise an error is generated.

Q50. What is the difference between runtime exception and compile time exception?

An exception that occurs at compile time is called a checked exception. This exception cannot be ignored and must be handled carefully. For example, if you use FileReader class to read data from the file and the file specified in class constructor does not exist, then a FileNotFoundException occurs and you will have to manage that exception. For the purpose, you will have to write the code in a try-catch block and handle the exception. On the other hand, an exception that occurs at runtime is called unchecked-exception.

With this, we have come to the end of PHP interview questions blog. I Hope these PHP Interview Questions will help you in your interviews. In case you have attended any PHP interview in the recent past, do paste those interview questions in the comments section and we’ll answer them. You can also comment below if you have any questions in your mind, which you might face in your PHP interview.

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow us on Facebook | Twitter

Learn More

PHP for Beginners - Become a PHP Master - CMS Project

Learn Object Oriented PHP By Building a Complete Website

PHP OOP: Object Oriented Programming for beginners + Project

Laravel PHP Framework Tutorial - Full Course for Beginners (2019)

Laravel 5.8 Tutorial from Scratch for Beginners

50+ Java Interview Questions for Programmers

Top 100 Python Interview Questions and Answers

Top 100 Python Interview Questions and Answers

Best 50 React Interview Questions and Answers in 2019

Top 50+ SQL Interview Questions and Answers in 2019

Best 50 Nodejs interview questions from Beginners to Advanced in 2019

100+ Java Interview Questions and Answers In 2019

Best 50 React Interview Questions for Frontend Developers in 2019

Best 50 Angular Interview Questions for Frontend Developers in 2019