Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Hi guys, i'm sure you all know the unserialze() function in PHP. I need the same thing for IOS. Basically i got a string from db field which looks like this : a:4:{i:0;s:6:"Vincent";i:1;s:14:"Julie";i:2;s:12:"Tomas";i:3;s:10:"John";}
I would like the correct function to display the above string as : Vincent, Julie, Tomas, John.
Hi guys, i'm sure you all know the unserialze() function in PHP. I need the same thing for IOS. Basically i got a string from db field which looks like this : a:4:{i:0;s:6:"Vincent";i:1;s:14:"Julie";i:2;s:12:"Tomas";i:3;s:10:"John";}
I would like the correct function to display the above string as : Vincent, Julie, Tomas, John.
No, I don't know the PHP unserialze (unserialize?) command.
In general terms, it looks like a command that takes a variable (or object) and converts it to a byte-stream. That concept exists in Cocoa as well. However, the details are different. I doubt you'll find a ready-made way to unserialize PHP variables/objects into Objective C, since they are different languages, and their data structures and constructs are different. PHP is loosely typed, for example, which is likely to cause problems in creating Objective C equivalent structures.
You'll probably have to restrict what you put the DB fields in PHP to a specific format (or small set of possible formats), and then write Objective C code that parses that specific format into Objective C data containers.
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
Thanks!! Guess what i've done is as suggested : make sure the data being serialised is in a readable format. I wanted to go the quickest route, but seems like that one was the longest but simpler!!
Thanks!! Guess what i've done is as suggested : make sure the data being serialised is in a readable format. I wanted to go the quickest route, but seems like that one was the longest but simpler!!
Thanks again
It will probably be easier to export the data in a format like JSON that is cross-platform.
You could also use a PHP implementation of property lists, like CFPropertyList
Binary property lists are a whole lot faster and more efficient than text-based formats like JSON (or worse yet XML)
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
Thanks!! Guess what i've done is as suggested : make sure the data being serialised is in a readable format. I wanted to go the quickest route, but seems like that one was the longest but simpler!!
Thanks again
Please elaborate your answer how did you manage this king of string parsing with objective C. I face same issues with magento api response. Did you perform string operation with this uneven structure or what ?
Replies
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeHope this helps.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeIn general terms, it looks like a command that takes a variable (or object) and converts it to a byte-stream. That concept exists in Cocoa as well. However, the details are different. I doubt you'll find a ready-made way to unserialize PHP variables/objects into Objective C, since they are different languages, and their data structures and constructs are different. PHP is loosely typed, for example, which is likely to cause problems in creating Objective C equivalent structures.
You'll probably have to restrict what you put the DB fields in PHP to a specific format (or small set of possible formats), and then write Objective C code that parses that specific format into Objective C data containers.
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks again
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeYou could also use a PHP implementation of property lists, like CFPropertyList
Binary property lists are a whole lot faster and more efficient than text-based formats like JSON (or worse yet XML)
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks in advance !!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome