Monday, October 30, 2017

php Functions

php Functions

Php has more function which are listed below and small description also mentioned . 



==>  foreach (food as element => innerarray)

==>  include "header.php"

==>  require "header.php" --> It kill hte page when the require statement not give 

==>  reqiore-once 'header.php'--> It will run only one time. 

==>  preg-match ('/word/', string)-->to check the world in string 

==> $_GET['var name']

==>  strpos(string,find string)

==>  substr-replace(string, startpos, end pos)

==>  str-replace(replace for, replace at, string)

==>  str-ireplace( replace for , replace at , string)

Forums actions

$_SERVER[HTTP-HOST];

$_SERVER[HTTP-CLIENT_IP];

$_SERVER['HTTP-X_FORWARDED_FOR'];

$_SESSION

Set session

session-start(); 

$_SESSION['name']='alex';

Unset session

unset($SESSION['name']);

Friday, October 27, 2017

string function

Types of String

php has operator and also string properties. Lets talk about string concept and operator in php. operator was used to operate operands and then give result to variable. 

Operators:

+,-,*, / these are basic operators. 
=== the exact value to check  

Die(); and exit();

exit(); statment to exit the page not execute down of 
die(); statement killing the page. 

Global  variable :

declare- variable -> global 'variable'

Ex
$_SERVER;
$_SERVER['REMOTE_ADDR'];

This statement leads to display the ip address of server machine. 

String Function()



Syntax:

str-word-count(variable)

|->This function used for count then strings word. 

str-word-count(variable, 0)   =>Display integer value 

str-word-count(variable,1)  => Display array EX: print-r(variable )

str-word-count(variable,2)  =>Display position 

str-word-count(variable,1,.)  =>It take aslo '.' as display

str-shuffle(sting)  => To display string as shuffle format.

strrev(string)  => To display string into reverser format

similar-text(string1, string2, result)

trim(string)

htmlentities(addslashes(string));

stripslashes(string);




Thursday, October 26, 2017

simple PHP funcitons.

simple PHP program


Syntax:
<?php 
statement 1
statement 2
?>


phpinfor();

  • information about installed php
  • php.ini file is a php configuration

strtolower(variable)

To change the string upper case to lower 

Echo "";


Print the given value

variable

Ex:
$var
$ila

Concatenation :

Combined 2 string is called concatenation.
Ex:
Echo "The date is ".$day.$date.' '. $year;

Monday, October 23, 2017

PHP Overview

PHP Overview


Php is a server side language. Which is executed by server application like xammp or winamp. Php scripts are back end process like database , sessions and also its shorten some function. Php scripts has predefined shorten functions. php can solve complex program in simple coding. 


Syntax:


<?Php 
Content of statements
?>

Example:


<?php
echo "Welcome to PHP ";
?>
 
Above simple program was just display Welcome message to viewers. PHP cannot run directly to webpage. Its use html to execute php script. Php functions are has multiple html shorten keyword. Php run on xammp or winamp server. Which are contain Mysql server and apachi servers. Mysql was used to store data. My favorite Web builder is PHP

ads

php Functions

php Functions Php has more function which are listed below and small description also mentioned .  ==>  foreach (food as ele...

ads