php 根据要求得到字符串的反序

php 根据要求得到字符串的反序

<?php
/**
 * 根据要求得到字符串的反序
 */

$s = ‘abcdefghijklmnopq’;
function Reverse_order($str,$start = null,$end = null)
{
   
    $string = ”;
    $string1 = ”;
    $string2 = ”;
    if ($start === null or $end === null)
    {
        for ($i = 0; ($char = $str{$i}) !== ”;$i++)
        {
            $string = $char.$string;
        }
        //var_dump($string);
    }
    if ((!is_int($start) or !is_int($end)) and $start !== null and $end !== null)   //将用户输入为数字字符串转化为整型
    {
        //如果是字母或者汉字转化后$start $end 都为0
        $start = (int)($start);
        $end = (int)($end);
        if ($start < 0)
        {
            trigger_error("起始值不能小于0",256);
            return false;
        }
    }
    if (is_int($start) and is_int($end))
    {
        for ($j = 0;$j < $start;$j++)
        {
            $string1 .= $str{$j};
        }
        for ($i = $start;$i < $end;$i++)
        {
            $string = $str{$i}.$string;
        }
        for ($k = $end; ($char = $str{$k}) !== ”; $k++)
        {
            $string2 .= $str{$k};
        }
    }
    /*if (!is_int($start ) or !is_int($end))
    {
        trigger_error("请输入数字",512);
        return false;
    }*/
    return $string1.$string.$string2;
}
$start = 0;
var_dump(
Reverse_order($s,$start,10),
Reverse_order($s,5,15),
Reverse_order($s,’10’,’15’),
//Reverse_order($s,’-5′,’15’),  //为负数的字符串转化后是负数
Reverse_order($s,’df’,’sd’),
Reverse_order($s,’的’,’地方’),  //不是为数字的字符串转化为整型后的是指都为零
Reverse_order($s)
);

作者:k7gxn56

波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

波比源码 » php 根据要求得到字符串的反序

94 评论

  1. buy sildenafil 100mg sale buy sildenafil estrace order

  2. order prednisone 40mg online cheap sildenafil 100mg sale viagra overnight shipping usa

  3. buy generic modafinil Cialis in usa diamox 250 mg cost

  4. doxycycline online clomid pill lasix 40mg without prescription

  5. prograf 5mg for sale labetalol online order urso 300mg online cheap

  6. order generic imuran 100 mcg real viagra sites order sildenafil 50mg generic

  7. buy avlosulfon 100mg pills fexofenadine pills perindopril 8mg without prescription

  8. buy piracetam 800mg for sale nootropil oral pfizer viagra

  9. cheap essays online slots free free roulette online

  10. order research paper online sildenafil 25 mg sildenafil next day

  11. order clomid 50mg without prescription purchase clomid roulette casino

  12. buy xenical 60mg without prescription diltiazem oral acyclovir 800mg brand

  13. buy allopurinol 100mg online cheap order ezetimibe zetia 10mg cheap

  14. buy baclofen 10mg generic zanaflex brand toradol 10mg over the counter

  15. colchicine 0.5mg price play slots slots games

  16. buy diflucan generic viagra on line order viagra 100mg pills

  17. buy actos 15mg without prescription buy viagra sale viagra overnight shipping usa

  18. buy generic cialis 5mg Buy now cialis casino online slots

  19. mesalamine 400mg ca azelastine 10 ml ca order irbesartan 150mg without prescription

  20. purchase minocycline sale neurontin for sale order terazosin online cheap

  21. ventolin buy online buy ventolin augmentin sale

发表评论

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系站长
赞助VIP 享更多特权,建议使用 QQ 登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡