How to use str rot13 in PHP
In this article I will explain how the str_rot13() function can be used in PHP.
str_rot13() function in PHP
- The str_rot13() function is used to perform the ROT13 encoding on a string.
- In str_rot13() function, Numeric and non-alphabetical characters remains untouched.
- The ROT13 encoding shifts every letter 13 places in the alphabet.
- Encoding and decoding are done by the same function
Syntax
Parameter
- string string is required parameter. it is specify for encode to the string.
Example
The following example show to how the str_rot13() function can be used in PHP.
<html>
<body>
<h3 style="color: darkblue;">str_rot13() function example in PHP</h3>
<?php
echo "ROT13 encoding of c-sharpcorner is : ".str_rot13("C-sharpcorner...");
echo "<br />";
echo "ROT13 encoding of Welcome is : ".str_rot13("Welcome");
?>
</body>
</html>
|
Output
You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here