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条)

报告相同问题?

悬赏问题

  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码