Category Archives: PHP Interview Question

Indian states list in PHP array

This section contains all the state of India in the form of associative array. The associative array having state code as key and state name as value. India has twenty eight state and seven Union territory, so total 35 states are listed below in the form of associative array. I hope it will help you guys to populate in the drop downs (Select).

 
28 Indian States list


$indian_states = array (
 'AP' => 'Andhra Pradesh',
 'AR' => 'Arunachal Pradesh',
 'AS' => 'Assam',
 'BR' => 'Bihar',
 'CT' => 'Chhattisgarh',
 'GA' => 'Goa',
 'GJ' => 'Gujarat',
 'HR' => 'Haryana',
 'HP' => 'Himachal Pradesh',
 'JK' => 'Jammu & Kashmir',
 'JH' => 'Jharkhand',
 'KA' => 'Karnataka',
 'KL' => 'Kerala',
 'MP' => 'Madhya Pradesh',
 'MH' => 'Maharashtra',
 'MN' => 'Manipur',
 'ML' => 'Meghalaya',
 'MZ' => 'Mizoram',
 'NL' => 'Nagaland',
 'OR' => 'Odisha',
 'PB' => 'Punjab',
 'RJ' => 'Rajasthan',
 'SK' => 'Sikkim',
 'TN' => 'Tamil Nadu',
 'TR' => 'Tripura',
 'UK' => 'Uttarakhand',
 'UP' => 'Uttar Pradesh',
 'WB' => 'West Bengal',
);


7 Union Territory

$indian_union_territory  = array (
 'AN' => 'Andaman & Nicobar',
 'CH' => 'Chandigarh',
 'DN' => 'Dadra and Nagar Haveli',
 'DD' => 'Daman & Diu',
 'DL' => 'Delhi',
 'LD' => 'Lakshadweep',
 'PY' => 'Puducherry',
);

All Indian states

$indian_all_states  = array (
 'AP' => 'Andhra Pradesh',
 'AR' => 'Arunachal Pradesh',
 'AS' => 'Assam',
 'BR' => 'Bihar',
 'CT' => 'Chhattisgarh',
 'GA' => 'Goa',
 'GJ' => 'Gujarat',
 'HR' => 'Haryana',
 'HP' => 'Himachal Pradesh',
 'JK' => 'Jammu & Kashmir',
 'JH' => 'Jharkhand',
 'KA' => 'Karnataka',
 'KL' => 'Kerala',
 'MP' => 'Madhya Pradesh',
 'MH' => 'Maharashtra',
 'MN' => 'Manipur',
 'ML' => 'Meghalaya',
 'MZ' => 'Mizoram',
 'NL' => 'Nagaland',
 'OR' => 'Odisha',
 'PB' => 'Punjab',
 'RJ' => 'Rajasthan',
 'SK' => 'Sikkim',
 'TN' => 'Tamil Nadu',
 'TR' => 'Tripura',
 'UK' => 'Uttarakhand',
 'UP' => 'Uttar Pradesh',
 'WB' => 'West Bengal',
 'AN' => 'Andaman & Nicobar',
 'CH' => 'Chandigarh',
 'DN' => 'Dadra and Nagar Haveli',
 'DD' => 'Daman & Diu',
 'DL' => 'Delhi',
 'LD' => 'Lakshadweep',
 'PY' => 'Puducherry',
)


PHP jobs in noida

PHP jobs in noida

Company : Mind Your Fleet (www.mindyourfleet.com)

Location : A-21, 2nd Floor, Sector 65, Noida

PHP Jobs in Noida

php-jobs-in-noida

WHO WE ARE:

Mind Your Fleet provides a SaaS-based, end-to-end enterprise tool which helps car rental companies to promote, manage and distribute their business online. Our state-of-the-art technology ensure that you never miss out on customers who prefer booking online. With exclusive features such as native booker-supplier-traveler apps, automated booking & dispatch scheduler, robust accounting and god’s-eye-view technology, we help you cater to every single aspect of your business through one single platform.

As part of a new and fast growing team of top notch engineers, you will experience all the excitement and dynamism of a startup along with the scale and technology of a world class enterprise.

Other Products: traviate.com & roomito.com

Job Description:

We are looking for a PHP developer who is dedicated to his craft, writes code that is proud of and can hit the ground running. We need you to write well designed(clean), fast PHP to a high standard, in a timely and scalable way that improves the code-base of our products in meaningful ways.

You will be a part of a creative team that is responsible for all aspects of the ongoing software development from the initial specification, through to developing, testing and launching.

Responsibilities:

PHP jobs in delhi for freshers, PHP Fresher job, PHP EXperience jobs

Produce detailed specifications
Troubleshoot, test and maintain the core product software and databases to ensure strong optimization and functionality
Contribute in all phases of the development life-cycle
Follow industry best practices
Develop and deploy new features to facilitate related procedures and tools if necessary

PHP jobs in delhi for freshers

REQUIREMENTS:

Proven software development experience in PHP
Framework – Any
Good To Have – MVC, Angular JS
Demonstrable knowledge of web technologies including MySQL, JavaScript, Jquery etc
Good knowledge of relational databases, version control tools and of developing web services
Experience in common third-party APIs (Google, Facebook, Ebay etc)
Passion for best design and coding practices and a desire to develop new bold ideas.

Kindly confirm your availability.

Email : umar.khan@traviate.com

 



how to get the server details in php

$_SERVER Data

$_SERVER is a super global array that containing information such as headers, paths, and script locations etc.
php server details
By using the $_SERVER  array you can get many server information like Server IP, Document root, Server name, server software and more.  The sever super global array are created by the server varies from server to server.

 

Here is all server element


 HTTP_HOST
 HTTP_CONNECTION
 HTTP_CACHE_CONTROL
 HTTP_ACCEPT
 HTTP_UPGRADE_INSECURE_REQUESTS
 HTTP_USER_AGENT
 HTTP_DNT
 HTTP_REFERER
 HTTP_ACCEPT_ENCODING
 HTTP_ACCEPT_LANGUAGE
 HTTP_COOKIE
 PATH
 SystemRoot
 COMSPEC
 PATHEXT
 WINDIR
 SERVER_SIGNATURE
 SERVER_SOFTWARE
 SERVER_NAME
 SERVER_ADDR
 SERVER_PORT
 REMOTE_ADDR
 DOCUMENT_ROOT
 REQUEST_SCHEME
 CONTEXT_PREFIX
 CONTEXT_DOCUMENT_ROOT
 SERVER_ADMIN
 SCRIPT_FILENAME
 REMOTE_PORT
 GATEWAY_INTERFACE
 SERVER_PROTOCOL
 REQUEST_METHOD
 QUERY_STRING
 REQUEST_URI
 SCRIPT_NAME
 PHP_SELF
 REQUEST_TIME_FLOAT
 REQUEST_TIME

 

Some important server elements


<?php
echo "Host: " . $_SERVER["HTTP_HOST"] . "<BR>";
echo "Browser: " . $_SERVER["HTTP_USER_AGENT"] . "<BR>";
echo "User's IP address: " . $_SERVER["REMOTE_ADDR"]."
";
echo "User's Software: " . $_SERVER["SERVER_SOFTWARE"]."
";
echo "User's name: " . $_SERVER["SERVER_NAME"]."
";
?>

 

Output


Host: localhost
Browser: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
User's IP address: ::1
User's Software: Apache/2.4.4 (Win64) PHP/5.4.12
User's name: localhost

 

Print complete server elements


<?php
echo "Complete Server Details";
foreach($_SERVER as $key => $value){
echo $key."=====".$value."</br>";
}
?>