jjzjj

timezone-offset

全部标签

php - codeigniter - 未初始化的字符串偏移量 : 0 and Illegal string offset

我在循环中循环,有错误。我以前尝试过,但现在不起作用。我的错误是:APHPErrorwasencounteredSeverity:NoticeMessage:Uninitializedstringoffset:0Filename:views/audit_trail_view.phpLineNumber:36Backtrace:File:C:\xampp\htdocs\cemo-marikina\application\views\audit_trail_view.phpLine:36Function:_error_handlerFile:C:\xampp\htdocs\cemo-mar

php - undefined offset PHP,不确定它的作用

这个问题在这里已经有了答案:"Notice:Undefinedvariable","Notice:Undefinedindex","Warning:Undefinedarraykey",and"Notice:Undefinedoffset"usingPHP(29个答案)关闭6个月前。我在PHPerror.log中有以下错误[TueDec1912:08:22.8875742017][:error][pid32196][clientxx.xx.xx.x:20560]PHPNotice:Undefinedoffset:8in/var/www/html/page.phponline55,ref

php - SimpleXMLElement 和警告 : Illegal offset type

警告:非法偏移类型我从xml输出中得到了这个变量var_dump($key);它给我object(SimpleXMLElement)#11(1){[0]=>string(5)"Cairo"}现在我想将“Cairo”作为获得其值(value)的关键$lang[]=array('Cairo'=>"Cairocity");执行此操作时出现错误echo$lang[$key];它给了我“警告:非法偏移类型”,因为键是SimpleXMLElement我怎样才能使它成为正常的var? 最佳答案 使用(string)$key将其转换为字符串。

php - 日期时间转换 : "The timezone could not be found in the database"

我正在尝试转换从API接收到的DateTime。这是他们生成日期时间字符串的方式:publicstaticfunctionformatDate($date){$format="Y-m-d\TH:i:sP";if($dateinstanceofDateTime){$d=$date->format($format);}elseif(is_numeric($date)){$d=date($format,$date);}else{$d=(String)"$date";}return$d;}这给了我"2013-06-14T04:00:36.000-03:00"这就是我将其转换回来的方法:try{

php - 反序列化()[函数。反序列化] : Error at offset 49151 of 49151 bytes

在将对象存储到数据库中而不是检索它之后,我像网站上的许多人一样出现了偏移错误。如果我不存储它一切正常:$serializedObject=serialize($this);$unSerializedObject=unserialize($serializedObject);此外,我在保存数据和从数据库中检索数据时使用base64编码,但这无济于事。我没有做任何逃避。我的对象处理一些字符串。我发现这个字符串:Awomanistravellingaroundtheworld.Sheis28yearsoldandsheisfromGreatBritain.Shecannotuseacaror

即使在设置 date_default_timezone_set 之后,PHPExcel 也会得到错误的时区

我正在使用http://phpexcel.codeplex.com在我的一个项目中,我遇到了一个问题。我想在单元格中写入time()值,我正在这样做:functionwriteTimeLine($objActiveSheet,&$lineNumber,$timeStart,$timeEnd,$duration,$category,$client,$date,$comment){$objActiveSheet->setCellValue('A'.$lineNumber,PHPExcel_Shared_Date::PHPToExcel($timeStart));$objActiveShee

PHP - undefined offset : 0

print_r($p->attachments)产生:Array([0]=>stdClassObject([id]=>...[url]=>http://...png[slug]=>...[title]=>...[description]=>...[caption]=>...[parent]=>...[mime_type]=>image/png[images]=>...()))我想访问url字段中的值print_r($p->attachments[0]->url)检索url,但也产生:Undefinedoffset:0现在我可以通过调用print_r(@$p->attachments[0

php - "Cannot use string offset as an array"错误

不知道这里出了什么问题。阅读人们在这里说的话:http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/在这里:Cannotusestringoffsetasanarrayinphp我在$entries(来自Google日历)中print_r()编辑了实际值,它们都很好。foreach($entriesas$e){$info=array();//addedtoseeifpre-declarationhelps$info=array($e['title']

PHP:带时区的 DateTime::createFromFormat()

我想将日期形式从d/m/Y转换为具有时区偏移量的Y-m-d。我可以使用以下代码将d/m/Y转换为Y-m-d:$date=DateTime::createFromFormat('d/m/Y',$date);$date=$date->format('Y-m-d');但我不确定如何添加时区偏移量。 最佳答案 (PHP5>=5.3.0)你实际上输入了第三个参数publicstaticDateTimeDateTime::createFromFormat(string$format,string$time[,DateTimeZone$timez

php - 如何找到特定 HH :MM time given a UTC offset in PHP? 的 UNIX 时间戳

我有一个以秒为单位的整数形式的UTC偏移量列表。例如-36000表示-10小时。我如何在PHP中具有该偏移量的位置找到UNIX时间戳,例如晚上10:00。PS:这不是作业谢谢 最佳答案 newDateTime($yourTimestamp,newDateTimeZone('UTC'));应该没问题 关于php-如何找到特定HH:MMtimegivenaUTCoffsetinPHP?的UNIX时间戳,我们在StackOverflow上找到一个类似的问题: htt