forked from timkang95/assignment3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParentClass.php
More file actions
34 lines (29 loc) · 722 Bytes
/
ParentClass.php
File metadata and controls
34 lines (29 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
// This is the file for the parent class
class ParentClass {
private $_text,
$_original,
$_time;
public function __construct($werds = array()){
if(is_array($werds))
$this->_text = implode(' ', $werds);
else
$this->_text = $werds;
$this->_original = $werds;
$this->_time = date('m/d/Y h:i:sa');
}
public function __toString(){
return 'Object converted to "'.$this->_text.'" created at '.$this->_time;
}
public function scrambler(){
if(is_array($this->_original)){
shuffle($this->_original);
echo "Shufflin: ".implode(' ', $this->_original);
}
else{
$temp = explode(' ', $this->_original);
shuffle($temp);
echo "Shufflin: ".implode(' ', $temp);
}
}
}