List Info

Thread: note 76054 added to language.oop5.magic




note 76054 added to language.oop5.magic
user name
2007-06-27 22:35:11
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;
?>
----
Server IP: 201.216.232.3
Probable Submitter: 190.136.169.43
----
Manual Page -- 
http://www.php.net/manual/en/language.oop5.magic.php
Edit        -- https://master
.php.net/note/edit/76054
Del: integrated  -- h
ttps://master.php.net/note/delete/76054/integrated
Del: useless     -- http
s://master.php.net/note/delete/76054/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/76054/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/76054/spam
Del: non-english -- 
https://master.php.net/note/delete/76054/non-english
Del: in docs     -- http
s://master.php.net/note/delete/76054/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/76054
Reject      -- https://mast
er.php.net/note/reject/76054
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 76054 deleted from language.oop5.magic by tularis
user name
2007-06-28 02:03:21
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


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )