You should try it.
User will enter a value and will get exact numbers of Asterisks Hollow Square:
<?PHP
$inputs = array();
if (isset($_POST['submit'])) { //to check if the form was submitted
$value = isset($_POST['input0'])? $_POST['input0'] : null;
for($count = 1; $value != null; $count++){
array_push($inputs, $value);
$value = isset($_POST['input'.$count])? $_POST['input'.$count] : null;
}
}
var_dump($inputs);
?>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<!-- to take multiple inputs copy the below line and change name="input" attribute -->
Enter input 1: <input type="text" name="input0" value="" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
$less = ($inputs[0]-2);
for ($fl=1; $fl<=$inputs[0]; $fl++)
{
echo "*";
if ($fl==$inputs[0])
{
echo "<br />";
}
}
for ($hstr=1; $hstr<=$less; $hstr++)
{
echo "*" . str_repeat(" ", $less) . "* <br />";
}
for ($ll=1; $ll<=$inputs[0]; $ll++)
{
echo "*";
}
?>
Post a Comment
Give your reviews about this blog. Leave your comments. what do you think about this post?
Comments Description is given below:
1) I love to read comments, but do not spam.
2) Like this blog and also tweet its posts.
3) You can use some xHTML tags.
4) All Comments are Do Follow, Please try to use blog professionally.
5) Mention Your Name below the comment.
6) You can also suggest for improvement.
7) Do not forget to subscribe Samee Articles blog.
---------------------------------------
Thanks for visiting QWC.Me.
==========================================
For free guidelines contact me on SEO Expert | Samee Ullah Feroz is online there.
==========================================
Best Regards