- json_decode: documentation ( source)
- print_r: documentation ( source)
- array_values: documentation ( source)
- preg_replace: documentation ( source)
- json_encode: documentation ( source)
<?php
class myArrayContainer{
function myArrayFunction(){
return $myArray = array(
"Name" => "John",
"LastName" => "Smith",
);
}
}
$myShitz = new myArrayContainer();
$myShit = $myShitz->myArrayFunction();
$myShitClass = new myArrayClass($myShit);
class myArrayClass {
function __construct($myArray){
echo ("Printing my Array as Recieved");
echo ("</br>");
print_r(array_values($myArray));
$myProcessClass = new myProcess($myArray);
}
}
class myProcess {
function __construct($sameArray){
$mySentence = json_encode($sameArray);
$mySentence = preg_replace('/a/', 'b', $mySentence);
$otherArray = json_decode($mySentence);
}
}