PHP

PHP Menu

PHP

strtr() Function - Definition, Syntax, Parameters, Examples

Definition

The strtr() function translates certain characters in a string.

Syntax

strtr(string, from, to)

Parameters

Parameter Description
string Required. Specifies the string to translate.
from Required (unless array is used). Specifies what characters to change.
to Required (unless array is used). Specifies what characters to change into.

Example

<?php
echo strtr("Welcome to PIP", "I", "H");

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods