Tell us what you are trying to do?
Trying to export through WP ALL IMPORT the data from User form generated in toolset. Would you help me to identify the php functions to get the data from this serialized data (obtained in Toolset Post Form): a:2:{s:64:"wpcf-fields-checkboxes-option-f7f9c7a19a5c90a0cbde74b0a6c57735-1";a:1:{i:0;s:11:"Mitigación";}s:64:"wpcf-fields-checkboxes-option-885b1ff227ab8644a29dbebe1d08ab27-1";a:1:{i:0;s:20:"Obras de terracería";}}
In my export, I want to see only "Mitigación" or "Obras de terracería"
Is there any documentation that you are following?
yes, this hidden link
Thank you Waqar.
I upload an image with the admin area. The problem is with the checkboxes only.
You can create an account and register a company here: hidden link
Additionally I uploaded an image with the option of WP ALL IMPORT to export with php function, maybe here we can figure out a solution with a php code.
On my test website, I was able to make this export work using the following custom PHP function:
function my_convert_checkbox_to_txt( $value ) {
// Return nothing if there is no value.
if ( empty( $value ) ) {
return null;
}
$target_values = array('one','two');
$return_values = array();
for ($i=0; $i < sizeof($target_values) ; $i++) {
if (strpos($value, $target_values[$i]) !== false) {
$return_values[] = $target_values[$i];
}
}
// Return comma-delimited list of values.
return implode( ', ', $return_values );
}
In my test, the checkboxes field had two checkbox options with values 'one' and 'two', respectively. But, on your website, you'll update the values in the array '$target_values', as per the values used by your checkboxes type field.
( screenshot: hidden link )
I'm having this error: Parse error: syntax error, unexpected ' ' (T_STRING) in your code on line 8
And the serialized persist. (please see the wpcf-obra-civiles field) in the preview.