* PHP stands for PHP: Hypertext Preprocessor .
* This is a widely-used scripting language that is especially suited for Web development .
* The main goal of the language is to allow web developers to create dynamically generated webpages .
* PHP is an open source software.It is free to download and use.
* Platform independent (windows , linux etc .)
* Easy to learn .
* Supports wide range of databases(Mysql,Oracle etc.) .
* It starts with <?php and ends with ?> tag.
* For Output , it use echo,print,print_r.
* Language Construct : Language constructs are something which executes directly without being parsed.
This is like reserved keyword which dealt directly with parser. The key difference between
functions and language constructs is the parser deals directly with language constructs and functions are mapped
and simplified to a set of language constructs before parsing. So these may or may not require parentheses and
the reason some have return values while others don't depends entirely on the specific technical details of the
PHP parser implementation. echo and print are language construct, but print_r() is a predefined function.
<?php $v = "hello world"; // variable in php represented by a dollar sign echo $v; ?>
It is not actually a function (it is a language construct) so you are not required to use parentheses with it .
<?php $state = 'orissa'; $cap = 'bbsr'; echo 'cap is $cap'; ?>
<?php $i=print('Hello World'); print $i; print '\n print() also works without \n parentheses.'; ?>
<?php $arr=array(array('name'=>'Debendra','batch'=>'5','designation'=>'programmer'), array('name'=>'Arun','batch'=>'5','designation'=>'programmer'), array ('name'=>'Satya','batch'=>'5','designation'=>'Tester'), array('name'=>'Rama','batch'=>'2','designation'=>'programmer')); print_r($arr); ?>
<?php $arr = Array('name'=>'Afixi Technologies Pvt Ltd','type'=>'software','total_emp'=>'50'); var_dump($arr); ?>
* Outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.
<?php $country='India'; print "$country";//India print '$country';//$country ?>
After editing Click here: |
Output:
|
Hello World
|