Normal Core PHP simple Input text box get string is viewed diamond shape.
Code:
Output Screen:
Code:
<form action="" method="post">
Enter the String : <input type="text" name="text" id="text" value="" />
<input type="submit" name="submit" id="submit" value="submit" />
</form>
<?php
error_reporting(0);
$string=$_POST['text'];
$len=strlen($string);
if(isset($_POST['submit']))
{
echo "<center>";
for($i=0;$i<$len;$i++)
{
for($j=0;$j<=$i;$j++)
{
echo $string[$j];
}
echo "<br>";
}
for($l=$i;$l>=0;$l--)
{
for($j=0;$j<$l;$j++)
{
echo $string[$j];
}
echo "<br>";
}
echo "</center>";
}
?>
Enter the String : <input type="text" name="text" id="text" value="" />
<input type="submit" name="submit" id="submit" value="submit" />
</form>
<?php
error_reporting(0);
$string=$_POST['text'];
$len=strlen($string);
if(isset($_POST['submit']))
{
echo "<center>";
for($i=0;$i<$len;$i++)
{
for($j=0;$j<=$i;$j++)
{
echo $string[$j];
}
echo "<br>";
}
for($l=$i;$l>=0;$l--)
{
for($j=0;$j<$l;$j++)
{
echo $string[$j];
}
echo "<br>";
}
echo "</center>";
}
?>