Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 2nd, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. What does (array) do in php?
  2. stdClass Object (
  3.  
  4. [ExampleCentre] => Array (
  5.  
  6. [0] => stdClass Object (
  7. [ID] => 14
  8. [Name] => mycity
  9. [Code] => exm
  10. [Email] => example.web@example.com
  11. [FB] =>
  12. [Address1] => Exm, example
  13. [City] => Hakuna Matata
  14. [PostCode] => 000000
  15. [County] =>
  16. [Fax] => Fax
  17. [Telephone] => 000222888
  18. [Location] => 01.000000,-0.00004
  19. [URL] => /holla/hakuna/example
  20. )
  21.        
  22. $obj = new stdClass;
  23. $obj->foo = 'value1';
  24. $obj->bar = 'value2';
  25. var_dump((array) $obj);
  26.        
  27. array(2) {
  28.   ["foo"]=>
  29.   string(6) "value1"
  30.   ["bar"]=>
  31.   string(6) "value2"
  32. }