Laravel - Validate at least one field from an array - php

I have this data:
[2022-12-07 11:56:19] local.INFO: array (
'name' => NULL,
'import_period' => NULL,
'google_ads_account' => NULL,
'period' => NULL,
'period_date_from' => NULL,
'period_date_to' => NULL,
'id_campaigns' =>
array (
0 =>
array (
'id_campaign' => NULL,
),
),
'id_adgroups' =>
array (
0 =>
array (
'id_adgroup' => NULL,
),
),
'campaign_name_contains' => NULL,
'adgroup_name_contains' => NULL,
'click' => 'less_than',
'click_value' => NULL,
'click_from' => NULL,
'click_to' => NULL,
'impressions' => 'less_than',
'impressions_value' => NULL,
'impressions_from' => NULL,
'impressions_to' => NULL,
'cost' => 'less_than',
'cost_value' => NULL,
'cost_from' => NULL,
'cost_to' => NULL,
'conversions' => 'less_than',
'conversions_value' => NULL,
'conversions_from' => NULL,
'conversions_to' => NULL,
'mapping_list' =>
array (
0 =>
array (
'value' => 'conversions',
'text' => NULL,
),
1 =>
array (
'value' => 'roas',
'text' => NULL,
),
2 =>
array (
'value' => 'all_conversions',
'text' => NULL,
),
3 =>
array (
'value' => 'all_conversions_from_interactions_rate',
'text' => NULL,
),
4 =>
array (
'value' => 'ctr',
'text' => NULL,
),
5 =>
array (
'value' => 'average_cpc',
'text' => NULL,
),
6 =>
array (
'value' => 'clicks',
'text' => NULL,
),
7 =>
array (
'value' => 'impressions',
'text' => NULL,
),
8 =>
array (
'value' => 'cost',
'text' => NULL,
),
9 =>
array (
'value' => 'conversions_value',
'text' => NULL,
),
10 =>
array (
'value' => 'conversions_from_interactions_rate',
'text' => NULL,
),
11 =>
array (
'value' => 'cost_per_conversion',
'text' => NULL,
),
12 =>
array (
'value' => 'search_click_share',
'text' => NULL,
),
13 =>
array (
'value' => 'search_impression_share',
'text' => NULL,
),
14 =>
array (
'value' => 'value_per_all_conversions',
'text' => NULL,
),
15 =>
array (
'value' => 'value_per_conversion',
'text' => NULL,
),
),
)
I am validating this data like this:
$validator = Validator::make($request->all(), [
'name' => 'required',
'import_period' => 'required',
'google_ads_account' => 'required',
'period' => 'required',
'period_date_from' => 'required_if:period,custom',
'period_date_to' => 'required_if:period,custom',
'id_campaigns.*.id_campaign'=> 'required',
'id_adgroups.*.id_adgroup' => 'required',
'campaign_name_contains' => 'required',
'adgroup_name_contains' => 'required',
'mapping_list.*.text' => 'required|min:1',
'click' => 'required',
'click_value' => 'required_if:click,greater_than,less_than',
'click_from' => 'required_if:click,between',
'click_to' => 'required_if:click,between',
'cost' => 'required',
'cost_value' => 'required_if:cost,greater_than,less_than',
'cost_from' => 'required_if:cost,between',
'cost_to' => 'required_if:cost,between',
'impressions' => 'required',
'impressions_value' => 'required_if:impressions,greater_than,less_than',
'impressions_from' => 'required_if:impressions,between',
'impressions_to' => 'required_if:impressions,between',
'conversions' => 'required',
'conversions_value' => 'required_if:conversions,greater_than,less_than',
'conversions_from' => 'required_if:conversions,between',
'conversions_to' => 'required_if:conversions,between',
]);
Here on this line 'mapping_list.*.text' => 'required|min:1' I am trying to validate this mapping_list array.
I want at least one field should be filled up but I have to fill up every element of this array.
Can you tell me is there anyting I am doing wrong?

If you want to validate that at least one field is filled, you must specify which field you want to validate. For example (in your code):
'mapping_list.*.text' => 'required|min:1',
you can change
'mapping_list.[0].text' => 'required|min:1',
or
'mapping_list.[1].text' => 'required|min:1',
That should be all you need to do. Hopefully that helps!

Related

How to output value of an array

I am a complete beginner in PHP. However I know how to output the value of custom field. I am having a bit of problems with arrays. The post meta key is fw_options. The value has multiple arrays and looks like this:
array (
0 =>
array (
'featured_post' => false,
'featured_expiry' => '',
'_featured_book_string' => '0',
'reading_level' => 'medium',
'reading_type' =>
array (
'time' => 'fixed',
'hourly' =>
array (
'hourly_read' => '',
'estimated_hours' => '',
),
'fixed' =>
array (
'reading_times' => '500',
),
),
'reading_duration' => 'one_month',
'english_level' => 'fluent',
'readers_level' => 'starter',
'expiry_date' => '2019/12/31',
'show_attachments' => 'off',
'read_documents' =>
array (
),
'address' => '',
'longitude' => '',
'latitude' => '',
'country' =>
array (
0 => '717',
),
),
)
I have this code which I have tried with no success:
$array = get_post_meta( get_the_ID(), 'fw_options', true );
echo $array[0]['reading_type']['fixed']['reading_times'];
How can I output the value 500 from the post meta key reading_times?
Simple Print array according to key
First hold the value into a variable than print according to array key
$data = array(
'featured_post' => false,
'featured_expiry' => '',
'_featured_book_string' => '0',
'reading_level' => 'medium',
'reading_type' =>
array(
'time' => 'fixed',
'hourly' =>
array(
'hourly_read' => '',
'estimated_hours' => '',
),
'fixed' =>
array(
'reading_times' => '500',
),
),
'reading_duration' => 'one_month',
'english_level' => 'fluent',
'readers_level' => 'starter',
'expiry_date' => '2019/12/31',
'show_attachments' => 'off',
'read_documents' =>array(),
'address' => '',
'longitude' => '',
'latitude' => '',
'country' =>
array(
0 => '717',
),
);
echo $data['reading_type']['fixed']['reading_times'];
Output #500

How to create an ARRAY in an ARRAY

I have this code (created from the admin side) in my wordpress Database postmeta table.
a:28:{s:12:"featuredItem";s:1:"0";s:10:"headerType";s:5:"image";s:11:"headerImage";s:60:"https://rocks---.de/wp-content/uploads/2018/08/IMG_2051.jpg";s:16:"headerImageAlign";s:10:"image-left";s:3:"map";a:7:{s:7:"address";s:6:"Goslar";s:8:"latitude";s:10:"51.9059531";s:9:"longitude";s:18:"10.428996299999994";s:10:"streetview";s:1:"0";s:9:"swheading";s:2:"90";s:7:"swpitch";s:1:"5";s:6:"swzoom";s:1:"1";}s:9:"telephone";s:4:"0221";s:19:"telephoneAdditional";a:3:{i:0;a:1:{s:6:"number";s:12:"111111111111";}i:1;a:1:{s:6:"number";s:13:"2222222222222";}i:2;a:1:{s:6:"number";s:13:"3333333333333";}}s:5:"email";s:20:"goslarEmail#email.de";s:9:"showEmail";s:1:"1";s:15:"contactOwnerBtn";s:1:"1";s:3:"web";s:27:"https://musicheadquarter.de";s:12:"webLinkLabel";s:17:"Label of the Link";s:19:"displayOpeningHours";s:1:"1";s:18:"openingHoursMonday";s:2:"12";s:19:"openingHoursTuesday";s:2:"12";s:21:"openingHoursWednesday";s:2:"12";s:20:"openingHoursThursday";s:2:"12";s:18:"openingHoursFriday";s:2:"12";s:20:"openingHoursSaturday";s:2:"12";s:18:"openingHoursSunday";s:2:"12";s:16:"openingHoursNote";s:26:"Text zu den Öffnungsziten";s:18:"displaySocialIcons";s:1:"1";s:26:"socialIconsOpenInNewWindow";s:1:"1";s:11:"socialIcons";a:2:{i:0;a:4:{s:5:"image";s:0:"";s:4:"icon";s:18:"fa-facebook-square";s:9:"iconColor";s:7:"#00FF00";s:4:"link";s:22:"http://rocks---.de";}i:1;a:4:{s:5:"image";s:0:"";s:4:"icon";s:12:"fa-instagram";s:9:"iconColor";s:7:"#00FF00";s:4:"link";s:20:"https://rocks---.de";}}s:14:"displayGallery";s:1:"1";s:7:"gallery";a:3:{i:0;a:2:{s:5:"title";s:6:"Bild 1";s:5:"image";s:60:"https://rocks---.de/wp-content/uploads/2019/01/IMG_8797.jpg";}i:1;a:2:{s:5:"title";s:6:"Bild 2";s:5:"image";s:60:"https://rocks---.de/wp-content/uploads/2019/01/IMG_8443.jpg";}i:2;a:2:{s:5:"title";s:6:"Bild 3";s:5:"image";s:60:"https://rocks---.de/wp-content/uploads/2018/08/IMG_8545.jpg";}}s:15:"displayFeatures";s:1:"1";s:8:"features";a:2:{i:0;a:3:{s:4:"icon";s:0:"";s:4:"text";s:15:"Feature Titel 1";s:4:"desc";s:28:"Feature Titel Beschreibung 1";}i:1;a:3:{s:4:"icon";s:0:"";s:4:"text";s:15:"Feature Titel 2";s:4:"desc";s:28:"Feature Titel Beschreibung 2";}}}
Now I tried to create the code for this ARRAY or what it is called. Everything works fine, exept the ARRAY in an ARRAY thing. Like, the list of social icons, image galelry and telephone numbers.
This is what I have so far:
$data = array(
'subtitle' => 'Utertitel',
'featuredItem' => '0',
'headerType' => 'image',
'headerImage' => 'https://rocks---.de/wp-content/uploads/slide3___beach-2179183_1920.jpg',
'headerHeight' => '375',
'map' => array(
'address' => $adresse,
'latitude' => $lat,
'longitude' => $lng,
'streetview' => '0',
'swheading' => '90',
'swpitch' => '5',
'swzoom' => '14'
),
'telephone' => '0221',
'telephoneAdditional' => '0228',
'email' => 'meister#rocks---.de',
'showEmail' => '1',
'contactOwnerBtn' => '1',
'web' => 'https://musicheadquarter.de',
'webLinkLabel' => '',
'displayOpeningHours' => '1',
'openingHoursMonday' => '12-17',
'openingHoursTuesday' => '12-17',
'openingHoursWednesday' => '12-17',
'openingHoursThursday' => '12-17',
'openingHoursFriday' => '12-17',
'openingHoursSaturday' => '12-17',
'openingHoursSunday' => '12-17',
'openingHoursNote' => 'Zusatzinfos zu den Öffnungszeiten',
'displaySocialIcons' => '0',
'socialIconsOpenInNewWindow' => '1',
'socialIcons' => array(
'icon' => 'fa-facebook-square',
'link' => 'https://rocks---.de'
),
'displayGallery' => '0',
'gallery' => array(
'title' => 'Titel des Bildes',
'image' => 'https://rocks---.de/wp-content/uploads/slide3___beach-2179183_1920.jpg'
),
'displayFeatures' => '0',
'features' => '0'
);
/* $data = maybe_serialize( $data ); */
update_post_meta( $post_id, '_ait-item_item-data', $data );
HOw do I create the ARRAY for the Images, social icons and telephone numbers.
I unserialized the Field Data and it shows the ARRAY, great!
array (
'featuredItem' => '0',
'headerType' => 'image',
'headerImage' => 'https://rockspots.de/wp-content/uploads/2018/08/IMG_2051.jpg',
'headerImageAlign' => 'image-left',
'map' =>
array (
'address' => 'Goslar',
'latitude' => '51.9059531',
'longitude' => '10.428996299999994',
'streetview' => '0',
'swheading' => '90',
'swpitch' => '5',
'swzoom' => '1',
),
'telephone' => '0221',
'telephoneAdditional' =>
array (
0 =>
array (
'number' => '111111111111',
),
1 =>
array (
'number' => '2222222222222',
),
2 =>
array (
'number' => '3333333333333',
),
),
'email' => 'goslarEmail#email.de',
'showEmail' => '1',
'contactOwnerBtn' => '1',
'web' => 'https://musicheadquarter.de',
'webLinkLabel' => 'Label of the Link',
'displayOpeningHours' => '1',
'openingHoursMonday' => '12',
'openingHoursTuesday' => '12',
'openingHoursWednesday' => '12',
'openingHoursThursday' => '12',
'openingHoursFriday' => '12',
'openingHoursSaturday' => '12',
'openingHoursSunday' => '12',
'openingHoursNote' => 'Text zu den Öffnungsziten',
'displaySocialIcons' => '1',
'socialIconsOpenInNewWindow' => '1',
'socialIcons' =>
array (
0 =>
array (
'image' => '',
'icon' => 'fa-facebook-square',
'iconColor' => '#00FF00',
'link' => 'http://festivaldate.de',
),
1 =>
array (
'image' => '',
'icon' => 'fa-instagram',
'iconColor' => '#00FF00',
'link' => 'https://rockspots.de',
),
),
'displayGallery' => '1',
'gallery' =>
array (
0 =>
array (
'title' => 'Bild 1',
'image' => 'https://rockspots.de/wp-content/uploads/2019/01/IMG_8797.jpg',
),
1 =>
array (
'title' => 'Bild 2',
'image' => 'https://rockspots.de/wp-content/uploads/2019/01/IMG_8443.jpg',
),
2 =>
array (
'title' => 'Bild 3',
'image' => 'https://rockspots.de/wp-content/uploads/2018/08/IMG_8545.jpg',
),
),
'displayFeatures' => '1',
'features' =>
array (
0 =>
array (
'icon' => '',
'text' => 'Feature Titel 1',
'desc' => 'Feature Titel Beschreibung 1',
),
1 =>
array (
'icon' => '',
'text' => 'Feature Titel 2',
'desc' => 'Feature Titel Beschreibung 2',
),
),
)
Now I need to know, how to create this part of the array. The number of images for the gallery is not fixed.
'gallery' =>
array (
0 =>
array (
'title' => 'Bild 1',
'image' => 'https://rockspots.de/wp-content/uploads/2019/01/IMG_8797.jpg',
),
1 =>
array (
'title' => 'Bild 2',
'image' => 'https://rockspots.de/wp-content/uploads/2019/01/IMG_8443.jpg',
),
2 =>
array (
'title' => 'Bild 3',
'image' => 'https://rockspots.de/wp-content/uploads/2018/08/IMG_8545.jpg',
),
),
Thanks for some tips,
Denis

How to remove current part from php file in php?

I have project for upload files on server, but I want to save them in php file ...
thats okay.. But when I want to delete them from the array with str_replace() It`s not happen...
from this array:
$files = array(
'2920525' => array(
'name' => 'Penguins',
'size' => '759.6 KB',
'unzip2920525' => NULL,
'pass2920525' => NULL,
'share2920525' => NULL,
'path' => 'uploads/anton_markov/99865723_Penguins.jpg',
),
'2683777' => array(
'name' => 'Lighthouse',
'size' => '548.1 KB',
'unzip2683777' => NULL,
'pass2683777' => NULL,
'share2683777' => NULL,
'path' => 'uploads/anton_markov/68670654_Lighthouse.jpg',
),
'6456807' => array(
'name' => 'Lighthouse - Копие - Копие',
'size' => '548.1 KB',
'unzip6456807' => NULL,
'pass6456807' => NULL,
'share6456807' => NULL,
'path' => 'uploads/anton_markov/94653321_Lighthouse---opie---opie.jpg',
),
'2363848' => array(
'name' => 'Koala',
'size' => '762.5 KB',
'unzip2363848' => NULL,
'pass2363848' => NULL,
'share2363848' => NULL,
'path' => 'uploads/anton_markov/15704345_Koala.jpg',
),
'6172497' => array(
'name' => 'Lighthouse',
'size' => '548.1 KB',
'unzip6172497' => NULL,
'pass6172497' => NULL,
'share6172497' => NULL,
'path' => 'uploads/anton_markov/53317261_Lighthouse.jpg',
),
);
I want to remove:
'6456807' => array(
'name' => 'Lighthouse - Копие - Копие',
'size' => '548.1 KB',
'unzip6456807' => NULL,
'pass6456807' => NULL,
'share6456807' => NULL,
'path' => 'uploads/anton_markov/94653321_Lighthouse---opie---opie.jpg',
),
I try with str_replace(),preg_replace() But nothing happen. I dont know why. When I remove the value from the array I want to save it. Please help me.
Just use unset.
unset($files['6456807']);

Get specific data from the array

Since I'm really unexperienced with PHP, I'm having trouble retrieving specific data from the following array that I receive via API:
I need the values of
'id'
'amount'
'statsTags'
Unfortunatly the following code retrieves an undefined index error:
echo $commissions['TPerformant\API\Model\Commission::__set_state']['id'];
This is the content of the var_dump
var_dump($commissions):
array (
0 =>
TPerformant\API\Model\Commission::__set_state(array(
'id' => 457171,
'userId' => 8917,
'actionid' => 456657,
'actiontype' => 'sale',
'amount' => '0.31',
'status' => 'pending',
'affrequestId' => NULL,
'description' => 'cosmetics|Mascara Extra Super Lash Curved Brush 8 mlx1 (7% from 6.66), cosmetics|Sampon uscat Blush Dry 50 mlx1 (7% from 8.33), cosmetics|Crema de maini si corp cu Lavandax1 (7% from 4.99)',
'createdAt' => '2016-12-24T16:48:07Z',
'updatedAt' => '2016-12-24T16:48:07Z',
'reason' => NULL,
'statsTags' => ',undefinedDesktopnulla60949bd-0b06-4fd6-a324-0d65351c10e9,',
'history' => NULL,
'currency' => 'EUR',
'workingCurrencyCode' => 'RON',
'programId' => 882,
'amountInWorkingCurrency' => '1.4',
'program' =>
TPerformant\API\Model\AffiliateProgram::__set_state(array(
'affrequest' => NULL,
'id' => NULL,
'slug' => 'elefant-ro',
'name' => 'elefant.ro ',
'mainUrl' => NULL,
'baseUrl' => NULL,
'description' => NULL,
'activatedAt' => NULL,
'userId' => NULL,
'uniqueCode' => NULL,
'status' => NULL,
'cookieLife' => NULL,
'tos' => NULL,
'productFeedsCount' => NULL,
'productsCount' => NULL,
'bannersCount' => NULL,
'approvalTime' => NULL,
'currency' => NULL,
'enableLeads' => NULL,
'enableSales' => NULL,
'defaultLeadCommissionRate' => NULL,
'defaultLeadCommissionType' => NULL,
'defaultSaleCommissionRate' => NULL,
'defaultSaleCommissionType' => NULL,
'approvedCommissionCountRate' => NULL,
'approvedCommissionAmountRate' => NULL,
'paymentType' => 'postpaid',
'balanceIndicator' => NULL,
'downtime' => NULL,
'averagePaymentTime' => NULL,
'logoId' => NULL,
'logoPath' => NULL,
'userLogin' => 'elefant',
'category' => NULL,
'countries' => NULL,
'ignoreIPs' => NULL,
'requester' =>
TPerformant\API\HTTP\Affiliate::__set_state(array(
'accessToken' =>
array (
0 => 'notrelevant',
),
'clientToken' =>
array (
0 => 'notrelevant',
),
'uid' =>
array (
0 => 'notrelevant',
),
'userData' =>
TPerformant\API\Model\Affiliate::__set_state(array(
'id' => 8917,
'email' => 'notrelevant',
'login' => 'notrelevant',
'name' => 'notrelevant',
'role' => 'affiliate',
'uniqueCode' => 'notrelevant',
'createdAt' => '2012-04-17T10:25:11Z',
'avatarUrl' => 'https://secure.gravatar.com/avatar/2aa7cbeda20ce7dee64a2764004ef7b5?d=https://network.2performant.com%2Fimg%2Favatar-default.jpg',
'newsletterSubscription' => true,
'userInfo' =>
stdClass::__set_state(array(
'address' => 'Bucuresti',
'city' => 'Bucuresti',
'country' => 'Romania',
'display_name' => 'regular',
'firstname' => 'Andrei',
'lastname' => 'Ioniță',
'organization' => '',
'phone' => '',
'state' => 'Bucuresti',
'typeofbusiness' => '',
)),
'requester' => NULL,
)),
)),
)),
'publicActionData' =>
stdClass::__set_state(array(
'created_at' => '2016-12-24T16:48:07Z',
'updated_at' => '2016-12-24T16:48:07Z',
'rate' => '7.0',
'amount' => '4.41',
'ad_type' => 'quicklink',
'ad_id' => '882',
'source_ip' => '109.99.30.73',
'description' => 'cosmetics|Mascara Extra Super Lash Curved Brush 8 mlx1 (7% from 6.66), cosmetics|Sampon uscat Blush Dry 50 mlx1 (7% from 8.33), cosmetics|Crema de maini si corp cu Lavandax1 (7% from 4.99)',
'working_currency_code' => 'RON',
'amount_in_working_currency' => '19.98',
)),
'publicClickData' =>
stdClass::__set_state(array(
'created_at' => '2016-12-24T16:13:20Z',
'source_ip' => '109.99.30.73',
'url' => 'https://www.maller.ro/voucher-elefant-ro-40-reducere/',
'redirect_to' => 'http://www.elefant.ro/oferte-speciale#utm_source=2parale&utm_medium=Campaign&utm_campaign=2c42f3c4e',
'stats_tags' => ',undefinedDesktopnulla60949bd-0b06-4fd6-a324-0d65351c10e9,',
)),
'requester' =>
TPerformant\API\HTTP\Affiliate::__set_state(array(
'accessToken' =>
array (
0 => 'notrelevant',
),
'clientToken' =>
array (
0 => 'notrelevant',
),
'uid' =>
array (
0 => 'notrelevant',
),
'userData' =>
TPerformant\API\Model\Affiliate::__set_state(array(
'id' => 8917,
'email' => 'notrelevant',
'login' => 'notrelevant',
'name' => 'Andrei Ioniță',
'role' => 'affiliate',
'uniqueCode' => 'notrelevant',
'createdAt' => '2012-04-17T10:25:11Z',
'avatarUrl' => 'https://secure.gravatar.com/avatar/2aa7cbeda20ce7dee64a2764004ef7b5?d=https://network.2performant.com%2Fimg%2Favatar-default.jpg',
'newsletterSubscription' => true,
'userInfo' =>
stdClass::__set_state(array(
'address' => 'Bucuresti',
'city' => 'Bucuresti',
'country' => 'Romania',
'display_name' => 'regular',
'firstname' => 'Andrei',
'lastname' => 'Ioniță',
'organization' => '',
'phone' => '',
'state' => 'Bucuresti',
'typeofbusiness' => '',
)),
'requester' => NULL,
)),
)),
)),

Get values from unserialized data

I have a serialized field in my database. I can get the contents of this field and unserialize them however I am unsure how to get certain values of these. I ultimately need a foreach of each item and value from the data.
In the below example I need to be able to get the following:
Main Image Replacement:
BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-14.JPG Complimentary:
Comp Text Quote Code: Code Text
I need the label as one variable and the value as another within a foreach. These labels and values are variable so I cannot manually get this data by their labels.
array (
0 =>
array (
'mode' => 'builder',
'cssclass' => '',
'hidelabelinorder' => '',
'hidevalueinorder' => '',
'element' =>
array (
'type' => 'radio',
'rules_type' =>
array (
'Reprint_0' =>
array (
0 => '',
),
'Edit Artwork_1' =>
array (
0 => '',
),
),
'_' =>
array (
'price_type' => '',
),
),
'name' => '',
'value' => 'Edit Artwork',
'price' => '',
'section' => '58073632e582b5.35893028',
'section_label' => '',
'percentcurrenttotal' => 0,
'currencies' =>
array (
),
'price_per_currency' =>
array (
'GBP' => '',
),
'quantity' => 1,
'multiple' => '1',
'key' => 'Edit Artwork_1',
'use_images' => '',
'changes_product_image' => '',
'imagesp' => '',
'images' => '',
),
1 =>
array (
'mode' => 'builder',
'cssclass' => '',
'hidelabelinorder' => '',
'hidevalueinorder' => '',
'element' =>
array (
'type' => 'radio',
'rules_type' =>
array (
'BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-14.JPG_0' =>
array (
0 => '',
),
'BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-21.JPG_1' =>
array (
0 => '',
),
'BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-77.JPG_2' =>
array (
0 => '',
),
),
'_' =>
array (
'price_type' => '',
),
),
'name' => 'Main Image Replacement',
'value' => 'BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-14.JPG',
'price' => '',
'section' => '58073632e582d2.46631826',
'section_label' => 'Main Image Replacement',
'percentcurrenttotal' => 0,
'currencies' =>
array (
),
'price_per_currency' =>
array (
'GBP' => '',
),
'quantity' => 1,
'multiple' => '1',
'key' => 'BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-14.JPG_0',
'use_images' => 'images',
'changes_product_image' => '',
'imagesp' => '',
'images' => 'http://burhill.immaculate.co.uk/wp-content/uploads/2016/10/BGL_Burhill_People_AndyHiseman_300dpi_Super-Size-14-150x150.jpg',
),
2 =>
array (
'mode' => 'builder',
'cssclass' => 'col-6',
'hidelabelinorder' => '',
'hidevalueinorder' => '',
'element' =>
array (
'type' => 'textfield',
'rules_type' =>
array (
0 =>
array (
0 => '',
),
),
'_' =>
array (
'price_type' => '',
),
),
'name' => 'Complimentary',
'value' => 'Comp Text',
'price' => '',
'section' => '58073632e582f4.32183997',
'section_label' => 'Complimentary',
'percentcurrenttotal' => 0,
'currencies' =>
array (
),
'price_per_currency' =>
array (
),
'quantity' => 1,
),
3 =>
array (
'mode' => 'builder',
'cssclass' => 'col-6',
'hidelabelinorder' => '',
'hidevalueinorder' => '',
'element' =>
array (
'type' => 'textfield',
'rules_type' =>
array (
0 =>
array (
0 => '',
),
),
'_' =>
array (
'price_type' => '',
),
),
'name' => 'Quote Code',
'value' => 'Code Text',
'price' => '',
'section' => '58073632e58317.46363272',
'section_label' => 'Quote Code',
'percentcurrenttotal' => 0,
'currencies' =>
array (
),
'price_per_currency' =>
array (
),
'quantity' => 1,
),
)
foreach($your_array as $key => $value) {
$your_value = $value['value'];
$your_label = $value['section_label'];
}
This should work for you as long as i got the right keys there.

Categories