Support

Account

Home Forums General Issues How to use Text Field or Text Area to create an array? Reply To: How to use Text Field or Text Area to create an array?

  • Hey, late response, but try this:

    $text_area = get_field("text_area");
    $text_area_arr = explode("\n", $text_area);
    $text_area_arr = array_map('trim', $text_area_arr);

    If you put each value on a new line in the text area, then $text_area_arr should be an array with each new line value. array_map is to get rid of extra white space.