Write a PHP script to accept a string and then display each word of string in reverse order.         (use concept of self processing form)

//StringRev.php

<html>
<body>
<form method=post action="<?php echo $_SERVER['PHP_SELF'] ?>">
Enter String : <input type=text name=str1><br>
<input type=submit name=submit>
</form>
<?php
if(isset($_POST['submit']))
            {
              $str=$_POST['str1'];
              $nstr=strrev($str);
echo"<br>".$nstr;
            }
?>
</body>
</html>

Comments

Popular posts from this blog

Create an XML file which gives details of books available in “ABC Bookstore” from following categories. 1)      Technical 2)      Cooking 3)      Yoga And elements in each category are in the following format.     …….     …….     ……. Save the file as “Book.xml” Create an application that reads “Book.xml” file into simple XML object. Display attributes and elements. (Hint:- Use simple_xml_load_file() function). 

Write a simple PHP program which implements Ajax for addition of two numbers

Write a PHP program to create a simple calculator that can accept two numbers and perform operations like add, subtract, multiplication and divide (using Self Processing form)