157. PHP Program to Concatenate two strings using static.
How does this program work?
- This program is used to Concatenate two strings using static in PHP.
Here is the code
<html>
<head>
<title>PHP Program To Concatenate two strings using static</title>
</head>
<body>
<form method="post">
<table border="0">
<tr>
<td> <input type="text" name="num1" value="" placeholder="Enter 1st string"/> </td>
</tr>
<tr>
<td> <input type="text" name="num2" value="" placeholder="Enter 2nd string"/> </td>
</tr>
<tr>
<td> <input type="submit" name="submit" value="Submit"/> </td>
</tr>
</table>
</form>
<?php
//error_reporting(0);
if(isset($_POST['submit'])) { $s1 = $_POST['num1'];
$s2 = $_POST['num2'];
$con = $s1." ".$s2;
echo "First String : ".$s1."</br>";
echo "Second String : ".$s2."</br>";
echo "Concatenation of two strings are: " .$con;
return 0;
} ?>
</body>
</html>