我想转换这些类型的值,'3','2.34','0.234343',等多项.我们可以在JavaScript中使用Number(),但PHP中是否有类似的方法?
Input Output
'2' 2
'2.34' 2.34
'0.3454545' 0.3454545
Run Code Online (Sandbox Code Playgroud) 我想知道如何在jQuery中使用Date()函数来获取yyyy/mm/dd格式的当前日期.
如何从给定日期获得年份和月份.
例如 $dateValue = '2012-01-05';
从这一天起,我需要将2012年和月份作为1月份.
我想在joomla日历中禁用日期范围.只能选择剩余的天数.我不知道该怎么做.Plz的帮助.
例如,如果我说2012-2-20到2012-3-20那么只有这个范围内的天可以选择所有其他必须禁用(或不能选择).
Joomla Calendar Doc http://docs.joomla.org/API16:JHtml/calendar
我想将文件夹中的所有文件和文件夹移动到另一个文件夹.我找到了将文件夹中的所有文件复制到另一个文件夹的代码. 将文件夹中的所有文件移动到另一个
// Get array of all source files
$files = scandir("source");
// Identify directories
$source = "source/";
$destination = "destination/";
// Cycle through all source files
foreach ($files as $file) {
if (in_array($file, array(".",".."))) continue;
// If we copied this successfully, mark it for deletion
if (copy($source.$file, $destination.$file)) {
$delete[] = $source.$file;
}
}
// Delete all successfully-copied files
foreach ($delete as $file) {
unlink($file);
}
Run Code Online (Sandbox Code Playgroud)
如何更改此项以将此文件夹中的所有文件夹和文件移动到另一个文件夹.
Joomla CMS的版本有什么区别,即Joomla 1.5,Joomla 1.6和joomla 1.7?
在这里,我发送电影ID并获取可用日期,我想将其设置为日历.但它不起作用,它禁用所有日期.从PHP返回日期字符串.日期字符串正确,但日历不起作用.请帮忙.
日期字符串示例
"28-02-2012","29-02-2012","01-03-2012","02-03-2012","03-03-2012","04-03-2012","05-03-2012","06-03-2012","07-03-2012","08-03-2012","09-03-2012","28-02-2012","29-02-2012","01-03-2012","02-03-2012","03-03-2012","04-03-2012","05-03-2012","06-03-2012","07-03-2012","08-03-2012","09-03-2012"
Run Code Online (Sandbox Code Playgroud)
码
jQuery.post('index.php', {
'option': 'com_movie',
'controller': 'reservation',
'task': 'datelist',
'format': 'raw',
'mid': movieid
}, function(result) {
var onlydates = result.split(',');
jQuery("#datepicker").datepicker({
dateFormat: 'yy-mm-dd',
showOn: "button",
buttonImage: "<?php echo IMAGES_LINK.'calendar.png';?>",
buttonImageOnly: true,
beforeShowDay: function(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
console.log(dmy + ' : ' + (jQuery.inArray(dmy, onlydates)));
if (jQuery.inArray(dmy, onlydates) != -1) {
return [true, "", "Available"];
} else {
return [false, "", "unAvailable"];
}
}
});
return;
});
Run Code Online (Sandbox Code Playgroud) 我有一张桌子
id h_id t_id
1 3 1
2 3 2
3 3 3
4 4 2
5 4 3
Run Code Online (Sandbox Code Playgroud)
id是主键。我还没有JTable为这个表创建一个。现在我想删除行h_id。有没有什么方法可以在不编写 sql DELETE 查询的情况下使用?
$db = JFactory::getDBO();
$row =& $this->getTable('tablename');
$row->delete($pk);
Run Code Online (Sandbox Code Playgroud)
任何更好的解决方案将不胜感激。
我有一个下表,我想知道如何使用Joomla中的JDatabaseQuery编写插入查询.
jos_esolutions_movies - table name
id, name, description, status - field names
1 , 'ABC' , 'ABC description', 0 - example values
Run Code Online (Sandbox Code Playgroud) 请考虑以下代码,
<form action="index.php" method="post" name="adminForm" enctype="multipart/form-data">
<input type="hidden" name="showtime[]" id="showtime_1" value="1" />
<input type="hidden" name="showtime[]" id="showtime_2" value="2" />
<input type="hidden" name="showtime[]" id="showtime_3" value="3" />
<input type="hidden" name="mid" id="movie_id" value="100" />
.
.
.
</form>
Run Code Online (Sandbox Code Playgroud)
我想用ajax帖子提交这个.
$.post('index.php',{
'option':'com_movies',
'controller':'movie',
'task' : 'savedata',
'format':'raw',
'mid':$('#movie_id').val()
},function(result){
if(result)
alert(result);
return;
});
Run Code Online (Sandbox Code Playgroud)
我想知道如何使用ajax post发送showtime id.