Forums

Custom code

Luc 19 Oct, 2013
On the submit button i've placed the action DB Record Load. After the step DB Record Load I placed the action Custom Code.

When I simply place this code
$text = $form->data['content1'];
echo $text;
I see the string where I'm looking for. But I only want a little piece of text of this string.

The total string is for example 1245=dog,5687=cat,4785=horse

I now want to become the word cat when I search for 5687

I tried with substr and pos but I could not fix it.
Can anybody help me ?
Thanks
Luc 19 Oct, 2013
I solved the problem.
GreyHead 20 Oct, 2013
Hi Luc,

Well done!

Here's some code that I might use for this:
<?php
$text_array = explode(',', $form->data['content1']);
$text = $text_array['5687'];
?>

Bob
This topic is locked and no more replies can be posted.