Home » PHP str_rot13() function

PHP str_rot13() function

by Online Tutorials Library

PHP string str_rot13() function

The str_rot13() is in-built PHP function. It is used to perform the ROT12 encoding on string.

This function encodes shifts every letter 13 place in the alphabet while numeric and non0alphabeticall characters remains untouched.

Note: This function encodes or decodes the data by same function.

Syntax:

Parameter Description Required/Optional
String Specify the string to encode required

Example 1

Output:

Before using str_rot13() function:Hello PHP  Before using str_rot13() function:Uryyb CUC  

Example 2

Output:

Before using str_rot13() function:Uryyb CUC  After using str_rot13() function:Hello PHP  

Example 3

Output:

Both string is is Equall: Hello PHP = Hello PHP  

Reference:

http://php.net/manual/en/function.str-rot13.php

Next TopicPHP String

You may also like