note 98227 modified in class.soapserver by danbrown

From: Date: Wed, 02 Jun 2010 22:35:13 +0000
Subject: note 98227 modified in class.soapserver by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169835@lists.php.net to get a copy of this message
If you want to return a custom object array from a nusoap webservice, you have to cast the objects to arrays like so: <?php $users = array(); while($res = $db_obj->fetch_row()) { $user = new user(); $user->Id = $res['id']; $user->Username = $res['username']; $user->Email = $res['email']; $users[] = (array) $user; } return ($users); ?> --was-- If you want to return a custom object array from a nusoap webservice, you have to cast the objects to arrays like so: $users = array(); while($res = $db_obj->fetch_row()) { $user = new user(); $user->Id = $res['id']; $user->Username = $res['username']; $user->Email = $res['email']; $users[] = (array) $user; } return ($users); http://php.net/manual/en/class.soapserver.php

« previous php.notes (#169835) next »