Plugin

Archived
Forum
(read-only)

CE String

ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

Exploding a Freeform field?

General

dbigca
dbigca

Hello,
I’d like to know if CE String can accomplish what I need.

I have taken a quick look at the documentation, but am unfamiliar with the base PHP that it enables.  I simply would like to know if this is possible.  If it is, I’ll purchase and scour the docs to figure it out.  If it’s not possible, I’ll move on.

The need:
I have a newline-delimited freeform field that I need to break out (explode) into separate <td></td> within <tr></tr>.

For example, a single freeform field contains values from 2 input fields (pairs) in a form with 5 entries…

Item1 code1
Item2 code2
Item3 code3
Item4 code4
Item5 code5

Which I need to place into an html table, with each pair in their own row…

<tr><td>Item1</td><td>code1</td></tr>
<
tr><td>Item2</td><td>code2</td></tr>
<
tr><td>Item3</td><td>code3</td></tr>
<
tr><td>Item4</td><td>code4</td></tr>
<
tr><td>Item5</td><td>code5</td></tr

Is this possible with CE String?

Thanks very much,
Doug Biggerstaff

 

dbigca
# 1
dbigca

Just to update this thread….

Using ‘preg_rep’ to search for and replace the newline-delimiters within the freeform field provided the solution I was looking for.

Doug Biggerstaff