无法从PHP StdClass对象爆炸
i am unable to explode an STDclass variable i have values in the object some what like mentioned below, but when i take the dump i get
I have stdClass Object ( [page_path] => 14-45-55 )
. When i try to explode this
$pages = $database->executeObjectList("SELECT page_path FROM tblwebpages WHERE page_id=" . $_GET['id']);
$explodedString = explode('-', $pages->page_path);
print_r($explodedString);
exit;
on taking dump of ($explodedString) i get
Array ( [0] => )
can i know what am i doing wrong if?
我无法分解STDclass变量我在对象中有一些值,如下所述,但是当我拿 我得到的转储 p>
我有 关于转储($ explosionString)我得到 p>
我能知道我做错了吗? p>
div> stdClass对象([page_path] => 14-45-55) code>。 当我试图爆炸这个 p>
$ pages = $ database-> executeObjectList(“SELECT page_path FROM tblwebpages WHERE page_id =”。$ _GET ['id']); \ n $ explosionString = explode(' - ',$ pages-> page_path);
print_r($ explosionString);
exit;
code> pre>
数组([0] = >)
code> pre>
Your $pages
, according to your comment, is actually an array (containing an object).
You need to do this instead:
$explodedString = explode('-', $pages[0]->page_path);