note 118202 added to language.oop5.serialization
| From: | (iamsmart9900@gmail.com) | Date: | Sun, 25 Oct 2015 14:30:13 +0000 |
| Subject: | note 118202 added to language.oop5.serialization | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204021@lists.php.net to get a copy of this message | ||
class UnSerializer {
public function __construct($filename_with_path) { /* Input the Filename */
$this->filename = $filename_with_path;
if ($this->filename == true) {
return true;
} else {
echo 'File Name Error';
}
}
public function check_file_validity() {
$this->validity = file_exists($this->filename);
if ($this->validity == true) {
return true;
} else {
echo 'File Not Found !';
}
}
public function getting_file_content() {
if ($this->validity == true) {
$this->content = file_get_contents($this->filename);
if ($this->content == true) {
return true;
} else {
echo 'We Can\'t Reach to the Data';
}
} else {
echo 'File Not Found !';
}
}
public function get_unserial_data() {
$this->check_file_validity();
$this->getting_file_content();
if (!is_null($this->content)) {
$this->unserializedval = unserialize($this->content);
if ($this->unserializedval == true) {
return true;
}
} else {
echo 'We Can\'t Reach to the Data';
}
}
public function get_unserialized_value() {
return $this->unserializedval;
}
}
$object = new UnSerializer('example_directory/filename'); /* Enter file name */
$object->get_unserial_data();
var_dump($object->get_unserialized_value());
----
Server IP: 72.52.91.14
Probable Submitter: 122.163.250.161
----
Manual Page -- http://php.net/manual/en/language.oop5.serialization.php
Edit -- https://master.php.net/note/edit/118202
Del: integrated -- https://master.php.net/note/delete/118202/integrated
Del: useless -- https://master.php.net/note/delete/118202/useless
Del: bad code -- https://master.php.net/note/delete/118202/bad+code
Del: spam -- https://master.php.net/note/delete/118202/spam
Del: non-english -- https://master.php.net/note/delete/118202/non-english
Del: in docs -- https://master.php.net/note/delete/118202/in+docs
Del: other reasons-- https://master.php.net/note/delete/118202
Reject -- https://master.php.net/note/reject/118202
Search -- https://master.php.net/manage/user-notes.php