By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,479 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,479 IT Pros & Developers. It's quick & easy.

Object to array

P: n/a
Is there a smarter way for this:
$line_elems=array($new->machine,
$new->channel,
$new->time,
$new->bday,
$new->eday,
$new->name);
$line = join(':',$line_elems);
$line="$line\n";

Is there a function (cast?) to convert object to an array without
listing all the
members?

Aug 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Aug 8, 5:24 am, Bart the bear <barttheb...@gmail.comwrote:
Is there a smarter way for this:
$line_elems=array($new->machine,
$new->channel,
$new->time,
$new->bday,
$new->eday,
$new->name);
$line = join(':',$line_elems);
$line="$line\n";

Is there a function (cast?) to convert object to an array without
listing all the
members?

get_object_vars

http://phpbuilder.com/manual/en/func...bject-vars.php

Aug 8 '07 #2

P: n/a
On Aug 8, 6:16 am, ELINTPimp <smsi...@gmail.comwrote:
>
get_object_vars

http://phpbuilder.com/manual/en/func...bject-vars.php

Thanks! That is precisely what I was looking for!

Aug 8 '07 #3

P: n/a
On Aug 8, 7:43 am, Bart the bear <barttheb...@gmail.comwrote:
On Aug 8, 6:16 am, ELINTPimp <smsi...@gmail.comwrote:
get_object_vars
http://phpbuilder.com/manual/en/func...bject-vars.php

Thanks! That is precisely what I was looking for!
Your welcome.

Aug 8 '07 #4

P: n/a
On Aug 8, 7:43 am, Bart the bear <barttheb...@gmail.comwrote:
On Aug 8, 6:16 am, ELINTPimp <smsi...@gmail.comwrote:
get_object_vars
http://phpbuilder.com/manual/en/func...bject-vars.php

Thanks! That is precisely what I was looking for!
You're welcome.

Aug 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.