开发者

php basic array question

I'm having trouble getting the value of the last insert Id from doctrine. I did a bit of research and I found that the following should work:

//save the store now
$store = new Store();
$store->url = $this->form_validation-开发者_开发知识库>set_value('website');
$store->save();
$store_id = $store->identifier();

echo print_r($store->identifier());

Returns

Array ( [id] => 1000034 )

How do I pull just the value (1000034) out of the array and set it in a variable that I can use elsewhere?


Your $store_id is an associative array with a single value keyed by "id" so:

$id = $store_id['id'];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜