How to solve the below query?
Write a program which takes name of user as a input in text box and truncate the name if it is more than 10 characters using truncate modifiers..
truncate.php
<?php
require 'smarty/libs/Smarty.class.php';
$smarty =new smarty();
$smarty->display('truncate.tpl');
?>
truncate.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="nirmal" />
<title>Untitled 4</title>
</head>
<body>
<form action="receive.php" method="post">
Name: <input type="text" name="name" />
</form>
{$a|truncate:10}
</body>
</html>
receive.php
<?php
require 'smarty/libs/Smarty.class.php';
$smarty =new smarty();
$b=$_POST["name"];
$smarty->assign('a','$b');
?>