php实现字符串反转输出的方法

yipeiwu_com5年前PHP代码库

本文实例讲述了php实现字符串反转输出的方法。分享给大家供大家参考。具体分析如下:

php中带有一个很简单的函数用于字符串反转,即strrev()

<?php
print strrev('This is not a palindrome.');
?>

输出结果如下

.emordnilap a ton si sihT

希望本文所述对大家的php程序设计有所帮助。

相关文章

PHP中的strtr函数使用介绍(str_replace)

strtr 有两种形式: string strtr ( string $str , string $from , string $to ) string strtr ( string $...

php中注册器模式类用法实例分析

本文实例讲述了php中注册器模式类用法。分享给大家供大家参考,具体如下: 注册器读写类 Registry.class.php <?php /** * 注册器读写类...

PHP正则匹配反斜杠'\'和美元'$'的方法

本文实例讲述了PHP正则匹配反斜杠'\'和美元'$'的方法。分享给大家供大家参考,具体如下: 1. test.php: <?php $content = '111111...

如何在PHP程序中防止盗链

example:     页面: dl.php      --------------...

Php Cookie的一个使用注意点

复制代码 代码如下:<?php setcookie('test', 'this is a cookie test'); echo ($_COOKIE['test']); ?>...