duanbeng8872 2014-09-30 07:53
浏览 25
已采纳

php rtrim未正确生成

<?php
$ret="Updated Date: 07-feb-2014 Creation Date: 07-feb-2014 Expiration Date: 07-feb-2015 >>> Last update of whois database: Tue, 30 Sep 2014 06:37:52 UTC <<< NOTICE: The expiration date displayed in this record is the date the registrar's sponsorship of the domain name registration in the registry is currently set to expire. This date does not necessarily reflect the expiration date of the domain name registrant's agreement with the sponsoring registrar";
   $str=explode("Creation Date:",$ret); echo rtrim($str[1],"Expiration");

?>

this is my php code, i used rtrim but it returns

07-feb-2014 Expiration Date: 07-feb-2015 >>> Last update of whois database: Tue, 30 Sep 2014 06:37:52 UTC <<< NOTICE: The expiration date displayed in this record is the date the registrar's sponsorship of the domain name registration in the registry is currently set to expire. This date does not necessarily reflect the expiration date of the domain name registrant's agreement with the sponsoring regis

but i need 07-feb-2014 as output, what can i do for this.

  • 写回答

2条回答 默认 最新

  • dousha7904 2014-09-30 08:03
    关注

    try this,

    $ret="Updated Date: 07-feb-2014 Creation Date: 07-feb-2014 Expiration Date: 07-feb-2015 >>> Last update of whois database: Tue, 30 Sep 2014 06:37:52 UTC <<< NOTICE: The expiration date displayed in this record is the date the registrar's sponsorship of the domain name registration in the registry is currently set to expire. This date does not necessarily reflect the expiration date of the domain name registrant's agreement with the sponsoring registrar";
           $str=explode("Creation Date:",$ret);
    $str2=explode("Expiration Date:",$str[1]); echo ($str2[0]);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 MATLAB动图的问题
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名