분류 php

객체 저장하기 (php)

컨텐츠 정보

  • 조회 579 (작성일 )

본문

코드 : 

abstract class Dog {
            public function __clone( ) {
                    echo "In dog clone\n";
            }
    }

    class Poodle extends Dog {
            public $Name;
                    public function __clone( ) {
                    echo "In poodle clone\n";
                    parent::__clone( );
            }
    }

    $poppy = new Poodle('Poppy');
    $safepoppy = urlencode(serialize($poppy));
echo $safepoppy;


결과 : 

O%3A6%3A%22Poodle%22%3A1%3A%7Bs%3A4%3A%22Name%22%3BN%3B%7D 



php