New object
Pages 0 from 51
Questions 0 from 84
Reset
<?php
// create new object
$obj = (object) array(); // OR
$obj = new stdClass();
$obj->key1 = "value1";
$obj->key2 = "value2";
var_dump($obj);
/*
object(stdClass)[1]
public 'key1' => string 'value1' (length=6)
public 'key2' => string 'value2' (length=6)
*/
https://stackoverflow.com
<?php
// create new object
$obj = (object) array(); // OR
$obj = new stdClass();
$obj->key1 = "value1";
$obj->key2 = "value2";
var_dump($obj);
/*
object(stdClass)[1]
public 'key1' => string 'value1' (length=6)
public 'key2' => string 'value2' (length=6)
*/
https://stackoverflow.com
More from Php








More from Programming


Powered by minte9.com