By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,303 Members | 1,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,303 IT Pros & Developers. It's quick & easy.

how can I trun this into array?

P: n/a
The return from a curl() cal
is:https_Ordernumber=https_card_number=*********** ***https_exp_date=1218https_amount=40.54https_cust omer_code=https_salestax=https_result=8https_resul t_message=NOT
APPROVEDhttps_txn_id=sjhdkjhskjdhkjhkjh2kj3h2kj389 723ihjk2h3https_approval_code=W837267671https_cvv2 _response=https_account_balance=0.00https_txn_time =08/30/2008
02:32:52 PMI need to get the variable "https_result" so I thought I could
put it in an array and then call it. I've tried (note aboce that some
variables are blank) :$pieces = explode(" ", $result);but it doesn't work as
hoped. I've tried:$pieces = explode("=", $result);but not working as
hoped.Any ideas?
Aug 30 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
TriAdmin schrieb:
The return from a curl() cal
is:https_Ordernumber=https_card_number=*********** ***https_exp_date=1218https_amount=40.54https_cust omer_code=https_salestax=https_result=8https_resul t_message=NOT
APPROVEDhttps_txn_id=sjhdkjhskjdhkjhkjh2kj3h2kj389 723ihjk2h3https_approval_code=W837267671https_cvv2 _response=https_account_balance=0.00https_txn_time =08/30/2008
02:32:52 PMI need to get the variable "https_result" so I thought I could
put it in an array and then call it. I've tried (note aboce that some
variables are blank) :$pieces = explode(" ", $result);but it doesn't work as
hoped. I've tried:$pieces = explode("=", $result);but not working as
hoped.Any ideas?

why not
$pieces = explode("https_", $result);

for test:
print_r($pieces);

?
Aug 30 '08 #2

P: n/a

"Olaf Schinkel" <tr***@schinkel.tvwrote in message
news:48***********************@newsspool2.arcor-online.net...
TriAdmin schrieb:
>The return from a curl() cal
is:https_Ordernumber=https_card_number=********** ****https_exp_date=1218https_amount=40.54https_cus tomer_code=https_salestax=https_result=8https_resu lt_message=NOT
APPROVEDhttps_txn_id=sjhdkjhskjdhkjhkjh2kj3h2kj38 9723ihjk2h3https_approval_code=W837267671https_cvv 2_response=https_account_balance=0.00https_txn_tim e=08/30/2008
02:32:52 PMI need to get the variable "https_result" so I thought I could
put it in an array and then call it. I've tried (note aboce that some
variables are blank) :$pieces = explode(" ", $result);but it doesn't work
as hoped. I've tried:$pieces = explode("=", $result);but not working as
hoped.Any ideas?
why not
$pieces = explode("https_", $result);

for test:
print_r($pieces);

?
thanks. that works part wise but there is another piece I di dnot add -
when it throws an error, the https_ variables are not part of the returned
value.

How ever, I think I can work my way through this - thanks
Aug 30 '08 #3

P: n/a
While the city slept, TriAdmin feverishly typed:
thanks. that works part wise but there is another piece I di dnot
add - when it throws an error, the https_ variables are not part of
the returned value.

How ever, I think I can work my way through this - thanks
Off the top of my head...

$string = "https_blah_etc.....";

$split = explode("https_", $string);
if($split[0] != $string)
{
// explode returns the whole string if delimiter not found, so
something is here
}
else
{
// no https_'s
}

Like I say, straight off the top of my head... off for beer now...

Cheers,
Nige

--
Nigel Moss | http://www.nigenet.org.uk
Email not valid. ni***@dog.nigenet.org.uk - take the dog out!
"You're mother ate my dog!", "Not all of him..."
Aug 30 '08 #4

P: n/a
"nice.guy.nige" <ni********@deadspam.comwrote in message
news:6h************@mid.individual.net...
While the city slept, TriAdmin feverishly typed:
>thanks. that works part wise but there is another piece I di dnot
add - when it throws an error, the https_ variables are not part of
the returned value.

How ever, I think I can work my way through this - thanks

Off the top of my head...

$string = "https_blah_etc.....";

$split = explode("https_", $string);
if($split[0] != $string)
{
// explode returns the whole string if delimiter not found, so
something is here
}
else
{
// no https_'s
}

Like I say, straight off the top of my head... off for beer now...

Cheers,
Nige

--
Nigel Moss | http://www.nigenet.org.uk
Email not valid. ni***@dog.nigenet.org.uk - take the dog out!
"You're mother ate my dog!", "Not all of him..."
Ah hah - the ol' double split(), good thinking. thanks - I dig your web
site also. I like when good people don't take themselves very seriously.
Aug 31 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.