I have a database field named 'manufacturer' with some numbers separated by a pipe.
e.g 1572|906|1573
I would like to select the first number and store it as a variable.
This is my woeful effort that has yielded no success.
$thisproductmansarray=array(); //declare the array
$thisproductmans=$myfield["manufacturer"]; //For page title / breadcrumb etc
$xxarray=implode("|", $thisproductmans[$key]);
foreach($thisproductmans as $key=>$val){
$thisproductmansarray[]=$xxarray++;
echo $thisproductmansarray[0];
}
Could anybody give me a pointer. Thanks
substr( $string, 0, strpos( $string, '|' ) );