Thursday, August 25, 2016

PHP Constant Functions

PHP Constant

<?php
//define a constant
define("GREETING","Hello you! How are you today?");

echo constant("GREETING");
?>

Tuesday, August 23, 2016

How to Use String Functions in PHP

addcslashes() Returns a string with backslashes in front of the specified characters

addslashes() Returns a string with backslashes in front of predefined characters

bin2hex() Converts a string of ASCII characters to hexadecimal values

chop() Removes whitespace or other characters from the right end of a string

chr() Returns a character from a specified ASCII value

chunk_split() Splits a string into a series of smaller parts

convert_cyr_string() Converts a string from one Cyrillic character-set to another

convert_uudecode() Decodes a uuencoded string

convert_uuencode() Encodes a string using the uuencode algorithm

count_chars() Returns information about characters used in a string

crc32() Calculates a 32-bit CRC for a string

crypt() One-way string hashing

echo() Outputs one or more strings

explode() Breaks a string into an array

fprintf() Writes a formatted string to a specified output stream

get_html_translation_table() Returns the translation table used by htmlspecialchars() and htmlentities()

hebrev() Converts Hebrew text to visual text

hebrevc() Converts Hebrew text to visual text and new lines (\n) into <br>

hex2bin() Converts a string of hexadecimal values to ASCII characters

html_entity_decode() Converts HTML entities to characters

htmlentities() Converts characters to HTML entities

htmlspecialchars_decode() Converts some predefined HTML entities to characters

htmlspecialchars() Converts some predefined characters to HTML entities

implode() Returns a string from the elements of an array

join() Alias of implode()

lcfirst() Converts the first character of a string to lowercase

levenshtein() Returns the Levenshtein distance between two strings

Describe the PHP Data Types

PHP Data Types

Variables can store data of different types, and different data types can do different things.
PHP supports the following data types:
  • String
  • Integer
  • Float (floating point numbers - also called double)
  • Boolean
  • Array
  • Object
  • NULL
  • Resource

Monday, August 22, 2016

How to Write Echo and Print Statement in PHP?

Echo and Print Statement

Echo is a print statement which is used for getting output. Both are more less same.

The code of Echo are –

<?php

echo " <h2> How to use Echo script </h2>";
echo " This is lutfar rahman learning echo programm<br>";
echo " This is lutfar's rahman learning echo programm <br>";
echo "This", "is lutfar's rahman", "learning echo", "programm";

?>

Saturday, August 20, 2016

What is Variables? Types of PHP Variables.

PHP Variables


Php language have some variables. which is used in scripting. The variable start wih "$" sign here. The variable is container. If you use text variables than double quotes the value. e.g. "Hello Rahman". Example of variables "$Mashiur" and "$mashiur" are two different variable. Now I am discussing different different types of variable here -

PHP Output Variables:

The echo statement is called output variables. Because it show output data on screen.

Example of PHP Output Variables:
<html>
<body>

<?php

$variables_faruk = "HI Faruk, How are you?";
echo "Hello Faruk.  " .$variables_faruk. "  Yes I am fine";

// Or another way we will get same output

$variables_faruk = "Hi Faruk, How are you?";
echo " Hello FAruk $variables_faruk Yes I am fine";



?>

</body>

</html>


// Result is : Hello Faruk. HI Faruk, How are you? Yes I am fine

Whats are the PHP Syntax ?

PHP Syntax 

The default file extension of  php is ".php". The php syntax are described and listed below:

How to Start PHP?

PHP code start is start with "<?php" and end with "?>". Flow the example below- 

<?php
// Inset or type the php code here as you know'
?>

Wednesday, August 17, 2016

Sum Subtract Multiply & Divide Formula in PHP


Sum Subtract Multiply & Divide Formula

Today I will show you how to php works with Sum Subtract Multiply and Divide Formula

<html>
<head>
<title>This is test site.</title>

</head>
<body>
<?php