消息:非法字符串偏移'标题' [英] Message: Illegal string offset 'title'

查看:95
本文介绍了消息:非法字符串偏移'标题'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

foreach($catgory as $key=>$value)
     {
        foreach($value as $catname=>$catvalue)
        {
            echo ($catvalue['title'])."<br/>";
        }
     }





消息:非法字符串偏移'标题'

< br $>




当我转储$ value时它会给出以下结果





Message: Illegal string offset 'title'



when i dump $value it gives the following

object(stdClass)#22 (13) {
  ["id"]=>
  string(1) "3"
  ["title"]=>
  string(9) "Project 1"
  ["user_id"]=>
  string(1) "2"
  ["description"]=>
  string(31) "<p>
    Project 1 Description</p>
"
  ["keywords"]=>
  string(20) "fsdfsd fd sfd sd d d"
  ["category_id"]=>
  string(1) "1"
  ["type"]=>
  string(5) "fixed"
  ["budget_min"]=>
  string(10) "4294967295"
  ["budget_max"]=>
  string(10) "4294967295"
  ["created_at"]=>
  string(19) "2014-01-27 19:05:16"
  ["updated_at"]=>
  string(19) "2014-01-29 17:20:01"
  ["file"]=>
  string(0) ""
  ["status"]=>
  string(7) "pending"
}









问题是如何获得标题?





the question is how to get title only ??

推荐答案

catgory as
catgory as


key =>
key=>


value)
{
foreach(
value) { foreach(


这篇关于消息:非法字符串偏移'标题'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆