Dave,
Try:
$postcode_parts = explode(" ", $postcode);
The first part of the postcode will be available in $postcode_parts[0].
- Chris
> -----Original Message-----
> From: Dave Carrera [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, April 04, 2002 5:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Please help count ?
>
> Hi All
>
>
>
> I have a variable returned by my application.
>
>
>
> For clarity it is a post code so result could be
>
>
>
> EX3 T56 or BG56 G67 or CA2 123
>
>
>
> But I only need the first bit of the postcode to continue my search.
>
>
>
> How do I set my var to only include the first bit of the postcode.
>
>
>
> It is returned in the format shown, so my question might be how I read
> only the first bit before the space.
>
>
>
> I fully appreciate any kind of help with this and as always thank you in
> advance for any help.
>
>
>
>
>
>
>
> Dave Carrera
>
> Php Developer
>
> http://davecarrera.freelancers.net
>
> http://www.davecarrera.com
>
>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php