fsuob Kehar
About
-
Profession
TEMPLATE CUTTER
Skills
Status Reports, Circuits
Posted Questions
No Question(s) posted yet!
Posted Answers
Answer
— Both are great choices, but they serve different purposes. Lambda is simpler and less expensive, while Elastic Beanstalk lets you run full.
Answer is posted for the following question.
Answer
TropiK Nutrition
Address: 55 Lake St, Cairns City QLD 4870, Australia
Answer is posted for the following question.
Do you know best smoothie bowls in Cairns, Australia?
Answer
1
php
2
class sample {
3
4
/* Member variables */
5
var $var1;
6
var $var2;
7
8
function __construct( $par1, $par2 )
9
{
10
$this->var1 = $par1;
11
$this->var2 = $par2;
12
}
13
}
14
15
// Creating the object
16
$myObj = new sample(1000, "second");
17
echo "Before conversion: \n";
18
var_dump($myObj);
19
20
// Converting object to associative array
21
$myArray = json_decode(json_encode($myObj), true);
22
echo "After conversion: \n";
23
var_dump($myArray);
24
?>
25
26
Output:
27
Before conversion:
28
object(sample)#1 (2) {
29
["var1"]=>
30
int(1000)
31
["var2"]=>
32
string(6) "second"
33
}
34
35
After conversion:
36
array(2) {
37
["var1"]=>
38
int(1000)
39
["var2"]=>
40
string(6) "second"
41
}
Source: Tutorials Point
Answer is posted for the following question.
How to convert object to array php (PHP Scripting Language)