[b]How the break data in Array..?? [/b]

Thread Solved

Join Date: Apr 2009
Posts: 83
Reputation: nish123 is an unknown quantity at this point 
Solved Threads: 0
nish123's Avatar
nish123 nish123 is offline Offline
Junior Poster in Training

[b]How the break data in Array..?? [/b]

 
0
  #1
Jun 1st, 2009
i have some data in an Array but i want only a particular part of it..!!
how can i get it..

for Example...
  1. Array
  2. (
  3. [0] => status=1&messages=xxxxxxxxx&credit=23.4;
  4. )

i just want to get status = 1

how can i get it..?? help me out...!!
Last edited by peter_budo; Jun 1st, 2009 at 2:31 pm. Reason: Keep It Organized - Avoid using an excessive amount of [bbcode] to alter font styles or to draw more attention to your post.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 793
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Master Poster

Re: [b]How the break data in Array..?? [/b]

 
0
  #2
Jun 1st, 2009
You can use a combination of the substr and strpos functions to achieve this.
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 78
Reputation: navi17 is an unknown quantity at this point 
Solved Threads: 5
navi17 navi17 is offline Offline
Junior Poster in Training

Re: [b]How the break data in Array..?? [/b]

 
1
  #3
Jun 1st, 2009
you can achive this by using explode function
suppose you have info. in array like
$array[0]
now by using explode function:
$exploded= explode('&',$array[0]);
now $exploded[0] will contain status=1

i hope this helps you.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 83
Reputation: nish123 is an unknown quantity at this point 
Solved Threads: 0
nish123's Avatar
nish123 nish123 is offline Offline
Junior Poster in Training

Re: [b]How the break data in Array..?? [/b]

 
0
  #4
Jun 2nd, 2009
i thnk explode convert string into array..!!
.
.
but here value itself an array.... does it work.?
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 83
Reputation: nish123 is an unknown quantity at this point 
Solved Threads: 0
nish123's Avatar
nish123 nish123 is offline Offline
Junior Poster in Training

Re: [b]How the break data in Array..?? [/b]

 
0
  #5
Jun 2nd, 2009
Okay i have tested... its working pretty fine with explode..!!!!
.
.
.
thnx maan..!!!
  1.  
  2. $arr = explode("&",$lines[0]);
  3. print_r($arr[0]);
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC