Answers for "to array php"

PHP
7

php object to array

//This works best
$array = json_decode(json_encode($object), true);
Posted by: Guest on January-28-2021
3

object to array php

$array = (array) $yourObject;
Posted by: Guest on September-18-2020
0

toarray php

<?php
$collection = new \Ds\Vector([1, 2, 3]);

var_dump($collection->toArray());
?>
Posted by: Guest on July-27-2021
0

php string to array

$array = explode(' ', $string);
Posted by: Guest on July-04-2021

Browse Popular Code Answers by Language