Forums

CF5: Decompose string of text field

sanma 28 Apr, 2020
Hello everyone, I would need to decompose string (always 27 characters long) of text field in all its characters and then pass them to tcpdf individually. I think we can solve everything by using "substr" php passed in the chronoform custom code block. Could anyone help me more specifically?
Thank you in advance.
GreyHead 28 Apr, 2020
Hi sanma,

What exactly do you need to do with the string? You will need some custom PHP to parse it.

Bob
sanma 28 Apr, 2020
Hi bob, actually I solved it with this code.

<?php
$form->data['zero'] = $form->data['Field'][0];
$form->data['one'] = $form->data['Field'][1];
.......
?>

But if the strings get longer I would like to find a recursive code that is always good.
sanma 28 Apr, 2020
thanks a lot bob!!!
This topic is locked and no more replies can be posted.