0

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...!! :(

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by nish123
1

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.

Votes + Comments
Good tip, I hadn't thought of using explode like this
0

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

0

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

$arr = explode("&",$lines[0]);
         print_r($arr[0]);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.