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);




No comments:

Post a Comment

ads

php Functions

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

ads