PHP Classes

returning arrays

Recommend this page to a friend!

      Soap Discovery  >  All threads  >  returning arrays  >  (Un) Subscribe thread alerts  
Subject:returning arrays
Summary:a slight modification to return associative arrays
Author:Michael Richey
Date:2011-10-18 05:49:44
Update:2011-10-18 05:52:09

  1. returning arrays   Reply   Report abuse  
Michael Richey - 2011-10-18 05:49:45
Modifying the regex pattern for the output allows returning associative arrays.

I've been mucking around with the class - making my own little modifications to suit the needs of my application, so the line numbers may vary.

around line 113, the second $pattern variable, add "stringArray|" to the beginning of the pattern and you will be able to return associative arrays as output.

I've successfully returned nested arrays, so this is pretty robust and within the SOAP spec.

Braulio, if you want a copy of the modified, I've accommodated complex request strings (get vars) and SSL detection, as well as the array return value modification.

  2. Re: returning arrays   Reply   Report abuse  
Michael Richey - 2011-10-18 05:52:09 - In reply to message 1 from Michael Richey
A little further explanation:

The "stringArray" must be at the beginning of the pattern, otherwise "string" will match before "stringArray". Basically, it needs to be before "string"

I haven't needed it, but I suppose that stringObject would be valid as well, but this is untested in my application.