Printing welcome message and then reverse the string

Form input and string reversal

Read the submitted value with the null coalescing operator, trim it, and escape it before displaying it. strrev() reverses a byte string; for full Unicode grapheme handling, additional Unicode-aware processing is needed.


echo \"<form name=f1 method=post action=''>
<input type=text name=t1><input type=submit value='Submit'></form>\";
$t1=trim($_POST['t1'] ?? ''); // Collect the submitted string
if(strlen($t1) > 1 ){ // If the length of the string is more than 1
echo \"Welcome $t1<br>
Your name in reverse : \".strrev($t1);
}


All Basic Codes


Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer