Tag: PHP的

在PHP中添加三个月的date

我有一个名为$effectiveDate的variables,其中包含date2012-03-26 。 我正在尝试增加三个月到这个date,并在它不成功。 这是我所尝试的: $effectiveDate = strtotime("+3 months", strtotime($effectiveDate)); 和 $effectiveDate = strtotime(date("Ymd", strtotime($effectiveDate)) . "+3 months"); 我究竟做错了什么? 这两个代码的工作。

了解Magento中的getChildHtml

从2columns-right.phtml中的以下行开始 <div class="col-main"> <?php echo $this->getChildHtml('global_messages') ?> <?php echo $this->getChildHtml('content') ?> </div> 我无法理解, <?php echo $this->getChildHtml('content') ?>内容即将到来。 witch .phtml文件被调用来显示数据<?php echo $this->getChildHtml('content') ?>

函数里面的函数。

这段代码产生56的结果。 function x ($y) { function y ($z) { return ($z*2); } return($y+3); } $y = 4; $y = x($y)*y($y); echo $y; 任何想法是什么在里面? 我很困惑。

获取下一个星期一,星期二等的date

我想find星期一,星期二,星期三等等的date标记。如果那一天还没有到来,我希望下个星期这个星期。 谢谢!

可以在Ubuntu上使用xdebug吗?

我正在尝试debugging一些PHP代码,并想下载PHP的XDebugdebugging器。 我所看到的只有Windows下载二进制文件。 是否可以在Ubuntu上使用它?

使用PHPExcel设置电子表格单元格的宽度

我试图用ExcelExcel生成的Excel文档中设置单元格的宽度: $objPHPExcel->getActiveSheet()->getColumnDimensionByColumn('C')->setWidth('10'); $objPHPExcel->getActiveSheet()->getColumnDimensionByColumn('C')->setAutoSize(false); 但是这不起作用。 我需要在这里打电话的方法是什么?

我可以使用PHP检测IE6吗?

有没有办法使用PHP来检测是否正在使用IE6加载页面?

Laravel:未知列'updated_at'

我刚刚开始与Laravel,我得到这个错误: Unknown column 'updated_at' insert into gebruikers (naam, wachtwoord, updated_at, created_at)我知道这updated_at事情是从时间戳列当您迁移表,但我不使用updated_at 。 当我遵循Laravel教程时,我曾经使用它,但现在我正在(或试图制作)我自己的东西,即使我不使用时间戳,我也会得到这个错误。 我似乎无法find它被使用的地方。 这是代码: 控制器: public function created() { if ( ! User::isValidRegister(Input::all())) { return Redirect::back()->withInput()->withErrors(User::$errors); } // Register the new user or whatever. $user = new User; $user->naam = Input::get('naam'); $user->wachtwoord = Hash::make(Input::get('password')); $user->save(); return Redirect::to('/users'); } 路由: Route::get('created', 'UserController@created'); 该模型: public static […]

如何在PHP中join文件系统pathstring?

在PHP中是否有一个内置函数来智能地连接pathstring? 给定“abc / de /”和“/fg/x.php”作为参数的函数应返回“abc / de / fg / x.php”; 使用“abc / de”和“fg / x.php”作为该函数的参数应该给出相同的结果。 如果没有,有没有可用的课程? 分割path或删除其中的一部分也是有价值的。 如果你写了一些东西,你可以在这里分享你的代码吗? 总是使用“/”是可以的,我只为Linux编码。 在Python中有os.path.join() ,这很好。

如何validation$ _GET是否存在?

所以,我有一些PHP代码看起来有点像这样: <body> The ID is <?php echo $_GET["id"] . "!"; ?> </body> 现在,当我传递一个像http://localhost/myphp.php?id=26的ID时,它可以正常工作,但是如果没有像http://localhost/myphp.php这样的ID,那么它会输出: The ID is Notice: Undefined index: id in C:\xampp\htdocs\myphp.php on line 9 ! 我已经寻找一种方法来解决这个问题,但我找不到任何方法来检查是否存在一个URLvariables。 我知道一定有办法。