Affiliate Programs
 
Search affiliate programs for: 
Affiliate Categories
» Affiliate Networks
» Ad Networks
» 2 Tier Programs
» Pay Per Sale
» Pay Per Lead
» Residual Income
» Datafeeds
» Multi Tier Programs
» Business Opps
» Other Programs

Newsletter
Get newly added affiliate programs by email. Enter your email here:
Article Categories
» Affiliate Marketing
» Business
» Ecommerce
» Hosting
» Marketing
» Sales
» Web Designing
» Webmasters
» SEO & Promotion
» Working At Home
» Other Articles
» Affiliate Glossary


Go Back   AffiliateSeeking Forum > Website Creation, Design & Maintenance > Programming > PHP

PHP Discuss about your PHP scripting issues or help others with their PHP scripting problems.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-02-2010, 12:20 AM
Moses Moses is offline
Member
 
Join Date: Feb 2010
Posts: 66
Moses is on a distinguished road
Default PHP Multidimensional array problem

hi
PHP experts; here is my problem.

I have an api that returns an array, $services.

This command: print_r($services);

produces this:

Array ( [blogger] => Array ( [name] => Blogger [methods] => Array ( [0] => blog [1] => images ) ) [posterous] => Array ( [name] => Posterous [methods] => Array ( [0] => blog [1] => microblog [2] => status [3] => images ) ) [tumblr] => Array ( [name] => Tumblr [methods] => Array ( [0] => blog [1] => images ) ) [typepad] => Array ( [name] => TypePad [methods] => Array ( [0] => blog [1] => microblog [2] => status ) ) [vox] => Array ( [name] => Vox [methods] => Array ( [0] => blog ) ) [wordpress] => Array ( [name] => WordPress.com [methods] => Array ( [0] => blog [1] => microblog [2] => status ) ) [xanga] => Array ( [name] => Xanga [methods] => Array ( [0] => blog [1] => microblog [2] => status ) ) )

My question is this - how do I programmatically get to the strings in the [methods] strings above array, ie 'blog' , 'microblog', 'status'
__________________
Mobile Video
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-10-2010, 09:13 AM
jurwanwall jurwanwall is offline
Member
 
Join Date: Nov 2010
Posts: 85
jurwanwall is on a distinguished road
i am trying to setup a multidimensional array but my problem is that i can not get the right order from incoming data.

Explain

$x[1][11]=11;
$x[1]=1;

var_dump($x);

In the above code i get only x[1].

To right would be

$x[1]=1;
$x[1][11]=11;

var_dump($x);

But in my case i can dot ensure that x[1] will come first, and x[1][11] will come after.

Is there any way that i can use the first example and get right the array. Keep in mind that the array depth is large.

I am trying to get an array as tree

$x[node]=node data
$x[node][childs]=childs data
etc..

and from incoming data is not sure that node will come first and child second and i am looking for a solution to create the array right
__________________
Designer Sunglass Reviews
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:41 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0
© 2004-2011 AffiliateSeeking. All rights reserved.