Note Submitter: mark_sal
Reason: non-english
----
un caso en donde se trata de imprimir un objeto con valores
array, atraves del método echo.
<?php
class TestClass
{
public $foo = array();
public function funcion_ejemplo($foo) {
$this->foo = $foo;
}
public function __toString() {
if(!is_array($this->foo)){
return $this->foo;
}
else {
print_r($this->foo);
return '';
}
}
}
$class = new TestClass();
$class->funcion_ejemplo( array( '0', '1', '2', '3', '4',
'5' ,'6' ) );
echo $class;
?>
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|