954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

i have some data in an Array but i want only a particular part of it..!!
how can i get it..

for Example...

Array
(
[0] => status=1&messages=xxxxxxxxx&credit=23.4;
)


i just want to get status = 1

how can i get it..?? help me out...!! :(

nish123
Junior Poster in Training
83 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

You can use a combination of the substr and strpos functions to achieve this.

darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
 

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.

navi17
Junior Poster
118 posts since Oct 2007
Reputation Points: 15
Solved Threads: 6
 

i thnk explode convert string into array..!!
.
.
but here value itself an array.... does it work.?

nish123
Junior Poster in Training
83 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

Okay i have tested... its working pretty fine with explode..!!!!
.
.
.
thnx maan..!!! :)

$arr = explode("&",$lines[0]);
         print_r($arr[0]);
nish123
Junior Poster in Training
83 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You