Forum OpenACS Development: Re: Parsing PHP array

Collapse
4: Re: Parsing PHP array (response to 1)
Posted by Iuri Sampaio on
Brian,

PHP array data's sent to OACS via usual HTML form "post".

A bit of context info:

I have control over both sides, not a problem at all, though I haven't developed PHP side, which could turn out a bit tricky to code in the mess that it's already there.

On PHP side, the framework's dummy CakePHP. Data's grabbed from a simple mysql request, put into a html form then sent to OACS side.

i.e.: input type="hidden" name="expArray" value="?php print_r($exFullData[0]); ?"
...

It seems I'll have to do it any way. Whether amending PHP array on CakePHP, or parsing into TCL, when it arrives on OACS, No escapes.

Nevertheless, you guys got a point, it'd be easier if I got a JSON or XML working on PHP side. But I don't want to touch since it wasn't me who developed and it's a CakePHP core piece.

I'd rather use TCL regexp, substr,... let you know whether I succeed or not.

if anyone has a good glimpse about let us know.

The array output to be parsed is here

[10/Sep/2013:18:32:32][12268.1873581824][-default:8-] Notice: Array
(
[Experiences] => Array
(
[id] => 56
[name_en] => Great Experience
[name_es] =>
[name_pt] =>
[meta_keyword_en] =>
[meta_keyword_pt] =>
[meta_keyword_es] =>
[meta_description_en] =>
[meta_description_pt] =>
[meta_description_es] =>
[alias] => great-experience
[exp_group] => 0
[provider_id] => 38
[providers_id] => 15
[category] => 33
[sub_category] => 139
[occassion_id] =>
[recipient_id] =>
[sub_occassion] =>
[sub_recipient] =>
[descr_en] =>
[descr_es] =>
[descr_pt] =>
[city_id] => 103
[country] => 42
[expcode] => hsdhsh
[noofpeople] => 0
[duration1_en] =>
[price] => 100.00
[tags_en] =>
[tags_es] =>
[tags_pt] =>
[about_content_en] =>
[about_content_es] =>
[about_content_pt] =>
[more_detail_en] =>
[more_detail_es] =>
[more_detail_pt] =>
[video] =>
[noofviews] => 0
[creation_date] => 2013-09-02 19:06:36
[modified_date] => 0000-00-00 00:00:00
[status] => 1
[featured] => 1
[exchange] => yes
[expire_date] => 2014-09-02 19:06:36
[created_by] => 0
[user_type] => admin
[special_offer] => 0
[special_price] =>
[get_started] => 0
[booking_info_en] =>
[guidelines_en] =>
[weather_en] =>
[participants_en] =>
[spectators_en] =>
[instructors_en] =>
[what_to_wear_en] =>
[getting_there_en] =>
[what_included_en] =>
[what_not_included_en] =>
[valid_until_en] =>
[cancellation_policy_en] =>
[additional_information_en] =>
[cancellation_policy_pt] =>
[cancellation_policy_es] =>
[payment_en] =>
[payment_es] =>
[payment_pt] =>
[additional_information_pt] =>
[additional_information_es] =>
[booking_info_pt] =>
[booking_info_es] =>
[guidelines_pt] =>
[guidelines_es] =>
[weather_pt] =>
[weather_es] =>
[participants_pt] =>
[participants_es] =>
[spectators_pt] =>
[spectators_es] =>
[instructors_pt] =>
[instructors_es] =>
[what_to_wear_pt] =>
[what_to_wear_es] =>
[getting_there_pt] =>
[getting_there_es] =>
[what_included_pt] =>
[what_included_es] =>
[what_not_included_pt] =>
[what_not_included_es] =>
[valid_until_pt] =>
[valid_until_es] =>
[availability_en] =>
[availability_pt] =>
[availability_es] =>
[location_en] =>
[location_pt] =>
[location_es] =>
[duration_en] =>
[duration_pt] =>
[duration_es] =>
[more_participants_en] =>
[more_participants_pt] =>
[more_participants_es] =>
[more_additional_info_en] =>
[more_additional_info_pt] =>
[more_additional_info_es] =>
[how_to_cancel_en] =>
[prepayment_policy_en] =>
[how_to_cancel_es] =>
[prepayment_policy_es] =>
[how_to_cancel_pt] =>
[prepayment_policy_pt] =>
[deposite_pct] => 100.00
[currency] => AUD
[creditcard_require] => 1
[provider_infoarea_en] =>
[provider_infoarea_es] =>
[provider_infoarea_pt] =>
[duration1_es] =>
[duration1_pt] =>
[preferreddate] => yes
)

[city] => Array
(
[name_en] => Australia
[name_pt] =>
[name_es] =>
)

[country] => Array
(
[name_en] => Oceania
[name_pt] => Oceania
[name_es] => Oceania
)

[provider] => Array
(
[name] => Australia
[email] =>
[provider_image] => Fiji1228549.jpg
[phone_number] =>
[address_en] =>
[alias] => australia
[status] =>
)

)