我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Wordpress将the_date()存储在一个数组中

I have this code in a foreach loop:

<?php $current_date[] = the_date('F Y'); ?>

What Im trying to do is gather all the dates into an array

but when I print_r my array, nothing appears...how would I fix this?

the_dateis an echo, use

<?php $current_date[] = the_date('F Y', '','', false); ?>

the false turns the echo off.

http://codex.wordpress.org/Function_Reference/the_date

or as Pekka has it get_the_date('F Y');

近期文章

  • PHP按日期和年份分开数据
  • 解析错误:语法错误,/ server.php中的意外T_STRING [关闭]
  • 在zend框架2中插入多个记录
  • 在mysql中向old添加新数据
  • 猜猜游戏,没有数据传递到另一种形式
  • 从.txt文件填充表单中的选项值
  • 迭代私有属性中的数组保持
  • 将curl响应解析为可读表
  • 验证记录存在的数据库条件
  • 为什么Phing运行我的build.xml,然后说它不存在?
  • 当添加不同的sql查询条件时,Pagination Php不起作用
  • 为什么我的MySQL INSERT语句返回错误? PDOException SQLSTATE [42000]:
  • 如何使netbeans IDE了解其他项目中的类和方法以完成代码
  • 从复选框中获取多个值并存储在DB php中
  • 在Cognos中嵌入C#或PHP代码
  • 为时间反馈添加秒数
  • 如何在php中删除CSV文件中的空白行
  • 从免费服务器260mb发送邮件
  • 一种更有效的链接mysql表的方法
  • Codeigniter卷曲引号(尽管UTF-8整理)

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华