On Sun, 2007-01-21 at 16:49 +0100, Jochem Maas wrote:
> now we can get on with having a flame war as to the 'best' way to style
> your code, because obviously this is better ;-) ...
Game on! :B
> echo trim(substr((string)$forename, 0, 1).' '.$surname);
Surely any fool can see that yours is infer
Robert Cummings wrote:
> On Sun, 2007-01-21 at 16:27 +0100, Jochem Maas wrote:
>> Robert Cummings wrote:
>>> On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
>>>
$initial = (is_string($forename) && strlen($forename) > 0)
? $forename[0]
: ''
;
echo
On Sun, 2007-01-21 at 16:27 +0100, Jochem Maas wrote:
> Robert Cummings wrote:
> > On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
> >> >>
> >> $initial = (is_string($forename) && strlen($forename) > 0)
> >> ? $forename[0]
> >> : ''
> >> ;
> >>
> >> echo trim($initial.' '.$surnam
Robert Cummings wrote:
> On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
>> >
>> $initial = (is_string($forename) && strlen($forename) > 0)
>> ? $forename[0]
>> : ''
>> ;
>>
>> echo trim($initial.' '.$surname);
>>
>> ?>
>
> That sure is verbose Jochem...
agreed, it was don
On Sun, 2007-01-21 at 16:02 +0100, Jochem Maas wrote:
>
>
> $initial = (is_string($forename) && strlen($forename) > 0)
>? $forename[0]
>: ''
>;
>
> echo trim($initial.' '.$surname);
>
> ?>
That sure is verbose Jochem...
Cheers,
Rob.
--
.--
Christopher Deeley wrote:
> Can anyone tell me if there is a function to return the first letter in a
> string, such as:
>
> $surname="SMITH";
> $forename="ALAN";
>
> Is there a function which I can use to make $forename "A", so I can display
> it as A SMITH?
another alternative to the other ans
Hello Christopher Deeley,
Best regards,
=== At 2007-01-21, 21:49:06 you wrote: ===
>Can anyone tell me if there is a function to return the first letter in a
>string, such as:
>
>$surname="SMITH";
>$forename="ALAN";
>
>Is there a function which I can use to make $forename "A", so I
$firstchar = substr($string, 0, 1);
Read www.php.net/substr
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free
-Original Message-
From: Christopher Deeley [mailto:[EMAIL PROTECTED]
Sent: Sunday, Janu
8 matches
Mail list logo