doude4924 2011-07-18 20:16
浏览 45
已采纳

str_replace如何使用数组? [关闭]

why not worked str_replace? what do i do?

$date = $this->convert_date->JalaliToGregorian('1390','04','20'); ->> this output with json_encode -> [2011,7,11]
$da =  str_replace(",","/",$date);
echo json_encode ($da) ->> output  Array ["2011","7","11"]
  • 写回答

4条回答 默认 最新

  • dongzhi5386 2011-07-18 20:20
    关注

    The commas are not in the array. That's being added by json_encode. Try implode("/", $date); That will combine the three array elements using / as glue.

    Implode Documentation

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏