Linked Questions
16 questions linked to/from Convert var_dump of array back to array variable
3
votes
0
answers
180
views
Unserialize var_dump'ed structure [duplicate]
Is there a way to reconstruct a php structure from its var_dumped representation? That is, given something like
array(3) {
[0] =>
int(1)
[1] =>
string(1) "2"
[2] =>
array(1) {
...
1024
votes
32
answers
2.0m
views
Convert a PHP object to an associative array
I'm integrating an API to my website which works with data stored in objects while my code is written using arrays.
I'd like a quick-and-dirty function to convert an object to an array.
6
votes
6
answers
11k
views
How to create an array from output of var_dump in PHP?
How can I parse the output of var_dump in PHP to create an array?
0
votes
1
answer
1k
views
Php trying to get property of-non-object
I trying to get data from a webservices using php curl. I get this data
var_dump($result) result is
string(136) "array(1) { [0]=> object(stdClass)#10 (2) { ["guid"]=> string(23) "...
-1
votes
3
answers
120
views
Convert string (which is array) back to array [closed]
I've got a problem, if i retrieve a record from a database, it will return as a string. But I don't want that, because it should be an array:
var_dump($data)
returns
string(654) "Array ( [0] => ...
0
votes
2
answers
740
views
PHP: Creating an associative array programmatically
I have a return string from a 3rd party plugin that looks like a var_dump from an array. I'm trying to parse into a valid associative array. Looking at various examples and doing some tests with the ...
0
votes
2
answers
638
views
Parse.com PHP API Converting Object to Array
Using the Parse PHP API - I am calling a query to return an object from the table which is working great. Upon var_dump($parseobjecthere) I receive a nice hierarchical output of the object which I'd ...
0
votes
1
answer
493
views
Store array within a string as an array
Within the wp_posts WordPress table, I have a row stored for a post (custom post type) that literally stores the following within the post_content column:
Array
(
[test_price] => 39.00
[...
-2
votes
1
answer
467
views
PHP: performance oriented way of storing variables in a flat file? [closed]
I'm looking to store some basic information (just simple variables, not a database) which doesn't require any security (simple strings stored for case sensitivity, lets me skip a MySQL query to ...
0
votes
1
answer
181
views
String to Object conversion
I'm looping through a database table which holds some data related to external API responses.
Someone was saving the responses as text, like so:
object(stdClass)#5 (1) {
["CreateProspectResult"]=&...
-5
votes
4
answers
184
views
PHP reading array from txt file not working [closed]
Im not sure what I am doing wrong here. I have a txt file that stores and array:
Array
(
[0] => Array
(
[sku] => 123123
)
)
When I go ...
0
votes
1
answer
105
views
PhpUnit: how to create examples of data structures for testing?
Say you have a method that receives an array as a parameter. That method does some manipulation with that array and then outputs a different array.
public function createArrayForX(array $myArray){
...
1
vote
3
answers
81
views
php convert $str = '[0=>"hello",1=>"world"]'; into indexed array
I have a string stored on my database in the following format:
$str = '[0=>"hello",1=>"world"]';
I wish to convert this into an array which would have the 0,"hello" key-value pair, 1,"world" ...
-1
votes
1
answer
83
views
Convert array to different type
haven't touched PHP in ages and am a bit rusty. I need some guidance in where to go from here.
I've got two arrays that I want to compare and find the difference however I can't compare the two as ...
0
votes
1
answer
35
views
What is the easiest way to convert this string (PHP Array) to a JSON encoded string?
My error log has sent me an email which includes a big array of data, which was stored in the users session. This array SHOULD have been converted to a JSON encoded string and stored in my database ...