[FX.php List] Exploding the carriage returns within a Filemaker field

Gjermund Gusland Thorsen ggt667 at gmail.com
Sat Nov 25 03:40:44 MST 2006


nl2br()

2006/11/24, Gary Sprung <gary at gnurps.com>:
> Howdy,
> I am trying to use the explode() function to get the return-separated values
> within a Filemaker field into an array. I¹ll then do a foreach() on the
> array to display the values. I seem to be unable to get the delimiter
> character correct. The syntax explode("\r",$fieldcontents) does not work,
> yielding an array of only one element with all the values and their return
> characters. "\r\n" and "\n\r" are no better. Can anyone suggest what's going
> wrong here?
>
> Code:
> $FMvariable = $Data['FMfieldName'][0];
> $FMarray = explode("\r",$FMvariable);
>
> echo '<pre>';
> echo print_r($FMarray);
> echo '</pre>';
>
> Result:
>
> Array
> (
>     [0] => Board Volunteer Recruitment
> staff recruitment
> accessibility
> other
> )
> 1
>
> In the above, what I want is for "Board Volunteer Recruitment" to be one
> element, "staff recruitment" to be another element, "accessibility" a third,
> and "other" a fourth.
>
> Thanks,
> Gary
>
> --------
> Gary Sprung
> GNURPS Consulting
>
> gary at gnurps.com
> www.gnurps.com
>
> Landline: 720-565-9933
> Cell: 303-859-9331
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list