Wordpress Gravity Forms get List values

与世无争的帅哥 提交于 2019-12-05 20:51:33
eleclair

This is a serialized array so you can use the php function unserialize to extract the values.

$array_values = unserialize($entry['#']);  
print_r($array_values); //see what your values are.

Now that you have your values you can access them in your new $array_values array. Getting one value out of a serialized array in PHP

Information can be found from Gravity Form's Documentation - GF_Field_List

$list_values = unserialize( rgar( $entry, '3' ) ); 

// You will get an array like below
$list_values = array(
  array(
    'Column 1' => 'one',
    'Column 2' => 'two',
    'Column 3' => 'three',
  ),
  array(
    'Column 1' => 'i',
    'Column 2' => 'ii',
    'Column 3' => 'iii',
  ),
  array(
    'Column 1' => '1',
    'Column 2' => '2',
    'Column 3' => '3',
  ),
);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!