473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how can I trun this into array?

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
4 1292
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

"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: matt melton | last post by:
Hi there, I am trying to write a method that accepts an array of any primitive type and will return the same array without copying memory as an array of bytes. ie. I'd like to be able to do...
5
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript...
1
by: Pablo | last post by:
Hi, there, I have a table which has a field (Email) populated with Email address. I am trying to send email using MS Outlook to those addresses. Everything works fine except that a warning message...
6
by: Yanhao Zhu | last post by:
Hi, all, If I have an array like int m = new int { 0, 1, 2, 3 }, is there a way I can separate the array into two, like int m01 = somefunction?(m,0,2) // m01 will hold 1st and 2nd items in...
11
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
1
by: Divvy Bollocks | last post by:
// A big 7 and three-quarters size "Hello" to all C++ programmers out there. This here is the second program what I've // ever wrote, the first being a "Fuck off world you cunt" program. It's a...
7
by: theballz | last post by:
Hi, I am learning c programming and come across a problem i cant seem to solve. I have a file which i wish to parse and put certain lines (which do not contain a hash character) into an array...
102
by: BoogieWithStu22 | last post by:
I am running into a problem with a web page I have created when viewing it in IE6 on some machines. The page has a database lookup. The user enters an account name or number and clicks a lookup...
1
by: chiefychf | last post by:
I'm working on a school project and I am having a few issues... The program calls for three arrays a,b,c that have to be sorted, then compared to even or odd and stored in arrays d & e, then merge...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.