PHP beginner to master Part 3: Strings and numbers
echo $third .=$second;
Other Functions :Output will be as : hello from techtwinklers presented by arumugam.
Change case to upper case : strtoupper($third);
Change case to lowercase : strtolower($third);
Change the first letter of the paragraph as capital letter : ucfirst($third);
Change each word’s first letter to uppercase : ucwords($third);
Find a string inside a string : strstr($third,”searching word”);
Remove unwanted spaces at beginning and at end : trim($third);
find the string postion : strpos($third,”by”);
Integer operations :
We can use short hand assignment operator in PHP also.
$b += $a; //Add the $a and $b and store it in the $b;
and also -=,*=,/= also available in php.
Increment and decrement operator:
++$b , –$b; Used to increment or decrement the integer values.
There are many functions available for float values such as
Round($variable) : change the float to nearest interger value.
ceil($varible) : change the float value in to nearest high value.
floor(variable) : Change the float value in to nearest low value.
pow(value1,value2) : Find the power of first value.
rand() : Used to generate Random values of intergers.
rand(start_range,end_range) : used to generate random values in the specified range.
If you have any doubt or need more explanation in php please comment below we will help you to solve your issue.