strrev

(PHP 4, PHP 5, PHP 7, PHP 8)

strrev反轉字符串

說明

strrev(string $string): string

返回 string 反轉后的字符串。

參數(shù)

string

待反轉的原始字符串。

返回值

返回反轉后的字符串。

范例

示例 #1 使用 strrev() 反轉字符串

<?php
echo strrev("Hello world!"); // 輸出 "!dlrow olleH"
?>