• PHP Video Tutorials

PHP - Function Strtr



Syntax

strtr(string,from,to)

Definition and Usage

It used to translated character or replace substring

Return Values

It returns the translated string

Parameters

Sr.No Parameters & Description
1

string

It specifies input string

2

from

It specifies character to change

3

to

It specifies character to change into

4

array

It specifies what to change as a key or what to change as a value

Example

Try out the following example

<?php
   echo strtr("Hilla Warld","ia","eo");
?>

This will produce following result −

Hello World
php_function_reference.htm
Advertisements