cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Curl response returns weird characters

Hi,

 

When i send request to "authorize a credit card payment" using PHP Curl, it returns weird characters in response at start and end. Also i tried to convert Json response to PHP array then i got Null.  see screenshot

 

https://www.diigo.com/item/image/5slrw/h2ks

 

Thanks

jay71134
Contributor
1 REPLY 1

Hello jay71134,

 

What you are seeing are the BOM (byte order mark) at the beginning of the stream and EOF (end-of-file) byte at the end in the response. Depending on the client (in your case curl), these characters may or may not be visible. There may be several options to handle these characters:

  • use a client that automatically handles these characters from response before you get the data
  • use PHP SDKhttps://github.com/AuthorizeNet/sdk-php
  • write code to to handle and discard these characters appropriately (pl. remember BOM may be variable number of bytes)

 

Raj

 

ramittal
Authorize.Net Developer Authorize.Net Developer
Authorize.Net Developer