在我的PHP输出中,数字显示为1,234.56
如何将其更改为1234,56或1.234,56?
美国方式和欧洲方式是什么?
php是用美式方式工作的吗?
我有以下数据库.
CREATE TABLE IF NOT EXISTS `omc_order` (
`order_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL,
`total` decimal(10,2) NOT NULL,
`order_date` datetime NOT NULL,
`delivery_date` datetime NOT NULL,
`payment_date` datetime NOT NULL,
PRIMARY KEY (`order_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=32;
Run Code Online (Sandbox Code Playgroud)
我想创建一个统计页面,以查看每月的总付款和总订单.
在一个页面中,我想显示这样的东西.
Month Year Total Order Total Payment
Sep 09 800 760
Oct 09 670 876
Nov
...
...
Run Code Online (Sandbox Code Playgroud)
现在我不知道如何为此创建查询.
谁能给我一些想法如何处理这个?
我有一个跟随字符串,我想提取image123.jpg.
..here_can_be_any_length "and_here_any_length/image123.jpg" and_here_also_any_length
Run Code Online (Sandbox Code Playgroud)
image123可以是任意长度(newimage123456等),并且可以扩展为jpg,jpeg,gif或png.
我假设我需要使用preg_match,但我不太确定并且想知道如何编码它,或者我是否可以使用任何其他方法或功能.
我正在测试html 5视频标签.
我正在使用http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library和http://camendesign.co.uk/.
我下载了创意常用视频.
当我使用外部链接时,它会播放视频.所以我将视频上传到我的服务器但它没有播放.它询问我是要保存还是要求应用程序播放.
当我转到外部链接http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb400p.ogv时,它会自动在浏览器上播放.
我也在本地测试,但它也没有播放.
我希望有人能告诉我为什么以及如何解决这个问题.
这段代码有效.
<figure>
<video id="vid1" width="500" height="300" style="position:absolute"
poster="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb480.jpg"
durationHint="33"
controls = "true">
<source src="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb400p.ogv" />
<source src="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb_trailer_iphone.m4v"/>
</video>
</figure>
Run Code Online (Sandbox Code Playgroud)
事实并非如此.
<figure>
<video id="vid1" width="500" height="300" style="position:absolute"
poster="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb480.jpg"
durationHint="33"
controls = "true">
<source src="http://www.mywebsite.com/media/bbb400p.ogv" />
<source src="http://www.mywebsite.com/media/bbb_trailer_iphone.m4v"/>
</video>
</figure>
Run Code Online (Sandbox Code Playgroud)
这也不起作用.
<figure>
<video id="vid1" width="500" height="300" style="position:absolute"
poster="http://cdn.kaltura.org/apis/html5lib/kplayer-examples/media/bbb480.jpg"
durationHint="33"
controls = "true">
<source src="http://127.0.0.1/html5videotest/media/bbb400p.ogv" />
<source src="http://127.0.0.1/html5videotest/media/bbb_trailer_iphone.m4v"/>
</video>
</figure>
Run Code Online (Sandbox Code Playgroud) 我理解以下Java输出.
public class EchoTestDrive {
public static void main(String[] args){
Echo e1 = new Echo();
Echo e2 = new Echo();
int x = 0;
while (x<4){
e1.hello();
e1.count = e1.count + 1;
if (x==3){
e2.count = e2.count +1;
}
if(x>0){
e2.count = e2.count + e1.count;
}
x = x+1;
System.out.println("e1.count is " + e1.count);
System.out.println("e2.count is " + e2.count);
}
System.out.println(e2.count);
}
}
class Echo {
int count = 0;
void hello (){
System.out.println ("helloooooooo..");
}
}
Run Code Online (Sandbox Code Playgroud)
输出
helloooooooo..
e1.count …Run Code Online (Sandbox Code Playgroud) 我在MySQL中有以下数组结构.可能没有物品或许多物品; 这个例子只显示了三个.
Array
(
[0] => Array
(
[id] => 1
...
[start_time] => 09:00:00
[finish_time] => 10:20:00
...
)
[1] => Array
(
[id] => 2
...
[start_time] => 13:00:00
[finish_time] => 14:20:00
...
)
[2] => Array
(
[id] => 23
...
[start_time] => 18:05:00
[finish_time] => 19:35:00
...
)
etc etc
)
Run Code Online (Sandbox Code Playgroud)
我想在start_time和finish_time之间添加时间差,并找出PHP的总时间.
例如,上述应产生250分钟或4小时10分钟(80分钟+ 80分钟+ 90分钟).我该怎么做呢?
我有来自MySQL的以下输出.
Array
(
[0] => stdClass Object
(
[id] => 19
[date] => 2010-10-04 11:00:00
[course] => Yoga
[course_id] => 19
[count(*)] => 2
[capacity] => 20
)
[1] => stdClass Object
(
[id] => 20
[date] => 2010-10-04 13:00:00
[course] => Spin
[course_id] => 20
[count(*)] => 1
[capacity] => 24
)
...
...
Run Code Online (Sandbox Code Playgroud)
我可以得到日期,课程等,但我不知道如何用PHP获得计数(*).
foreach ($bookingnum as $key => $list){
echo "<tr valign='top'>\n";
echo "<td align='center'>".$list->date."</td>\n";
echo "<td align='center'>".$list->course."</td>\n";
// echo "<td align='center'>".$list->count(*)."</td>\n";
// this is wrong. how …Run Code Online (Sandbox Code Playgroud) 我有以下表格.形式有效.现在我想在选择其中一个选项时自动提交表单.
<div id='weeksubmit'><!-- I don't need this div -->
<form action="http://localhost/myapplication/index.php/courses/admin/index" method="post" class="autosubmit">
<label for='weekid'>Select Week</label>
<select name="weekid">
<option value="1">Uke 40 (04/10 - 10/10)</option>
<option value="2" selected="selected">Uke 41 (11/10 - 17/10)</option>
<option value="3">Uke 42 (18/10 - 24/10)</option>
<option value="4">Uke 43 (25/10 - 31/10)</option>
</select>
<input type="submit" name="submit" value="Change Week" /></form>
</div>
Run Code Online (Sandbox Code Playgroud)
我尝试了以下代码,但它不起作用.
谁能告诉我我做错了什么?
提前致谢.
$(".autosubmit select").change(function() {
$(this).submit();
});
Run Code Online (Sandbox Code Playgroud) 我刚把这个问题放在serverfault.com中,我知道这个问题可能会在Stackoverflow中被拒绝.
但我认为程序员知道的更好.
该统计数据显示,所有服务器端编程语言的网站中有75.2%使用PHP.
http://w3techs.com/technologies/overview/programming_language/all
此页面显示PHP是在顶级网站上使用排名最少的服务器端语言
http://w3techs.com/technologies/topsite/programming_language
Q1.这是否意味着PHP用于快速简便的网站,其他语言用于更复杂的网站?
Q2.为什么PHP排在最后?或者为什么大公司倾向于使用除PHP以外的其他语言?
更新:我知道facebook和其他biggies使用PHP.但它没有说明为什么在顶级网站中使用更多其他语言.
当我在我的托管公司(共享服务器)中使用getimagesize()时,我收到以下错误.
Message: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration
Filename: admin/admin_product_home.php
Run Code Online (Sandbox Code Playgroud)
获取图像图像大小的替代方法是什么?
提前致谢.
echo "<tr>\n";
echo "<td>".$list."</td>\n";
$filepath = base_url()."uploads/".$list;
echo "<td><img width=\"70px\" src='".$filepath."' /></td>";
echo "<td>";
$filesize = getimagesize($filepath);
echo "width: ".$filesize[0]. "px<br />";
echo "height: ".$filesize[1]. "px<br />";
echo "</td>";
echo "<td>";
...
...
Run Code Online (Sandbox Code Playgroud)
我正在使用codeigniter,你可以在base_url()中看到.
php ×6
java ×2
coldfusion ×1
getimagesize ×1
html5 ×1
jquery ×1
mysql ×1
numbers ×1
preg-match ×1
regex ×1
ruby ×1
server-side ×1
statistics ×1
video ×1