Jump to content

Recommended Posts

I'm presently formatting surnames like this:

 

$surname = ucfirst(strtolower($surname)))

 

.. so that

 

  • SMITH, and
  • smith

... both look like:

Smith.

 

That's all fine, but how do I ensure that...

  • O'BRIEN
  • o'brien
  • o' brien

 

... all look like

 

O'Brien

 

?

 

That is, where no spaces are allowed to appear in the surname and where the first letter, as well as the one following the apostrophe are both capitalised.

 

TIA

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/
Share on other sites

There's also things like McDonald where you'd just have to check for specific prefixes.  Ideally you should just give the user the ability to enter their name as they want it displayed rather than try and format it yourself.

 

I have to agree.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340508
Share on other sites

There's also things like McDonald where you'd just have to check for specific prefixes.  Ideally you should just give the user the ability to enter their name as they want it displayed rather than try and format it yourself.

 

I have to agree.

 

I'll second (or would it be third) that. You will NEVER get 100% accuracy. If you force the format based upon your rules you are going to save some names incorrectly. Granted, it might be a small percentage, but will sure makes those users unhappy. I have the problem that my last name routinely has an apostrophe added in many mailings I receive - even though I don't use one. It's disappointing to see that, but not a huge deal. But, if a website did that to my name and how it was displayed on that site I would be looking for a support email or phone number to voice my complaint. If you cannot get all the names correct then don't even try. Unless you are going to format it and then let the user approve it first.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340519
Share on other sites

There's also things like McDonald where you'd just have to check for specific prefixes.  Ideally you should just give the user the ability to enter their name as they want it displayed rather than try and format it yourself.

 

I have to agree.

 

I'll second (or would it be third) that. You will NEVER get 100% accuracy. If you force the format based upon your rules you are going to save some names incorrectly. Granted, it might be a small percentage, but will sure makes those users unhappy. I have the problem that my last name routinely has an apostrophe added in many mailings I receive - even though I don't use one.

I've had several instances of websites thinking they are smarter than me like this recently when trying to do security questions. Apple just recently made me pick 3 security questions. One of the options for the first question was "What was your first car". The third question option was "What was your least favorite car?". It wouldn't let me have the same car for both. Really Apple? My least favorite car WAS that car!!

The worst though is when websites tell me my mother's maiden name must be longer than 3 characters. Funny, her birth certificate says otherwise...

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340673
Share on other sites

Any time you place restrictions on the user, especially for personal information, you're going to run into problems.  Let them decide how their last names are capitalized, especially since there ARE no rules.  Macdonald and MacDonald are both acceptable capitalizations. 

 

Also, Jesi, and someone who once dated a Koh, I feel your pain for the string length limits on name fields. 

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340677
Share on other sites

I've had several instances of websites thinking they are smarter than me like this recently when trying to do security questions. Apple just recently made me pick 3 security questions. One of the options for the first question was "What was your first car". The third question option was "What was your least favorite car?". It wouldn't let me have the same car for both. Really Apple? My least favorite car WAS that car!!

 

Hold on a minute! Are you trying to say that Apple, of all companies, would actually implement some type of limiting ability and would think it was prudent or even preferred? Heck they might even refer to some such implementation as a "feature". I mean, c'mon, Apple and particularly it's user base are the epitome of humbleness. It's as if you might be implying that Apple would, in some way, be a little arrogant in thinking it is superior.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340704
Share on other sites

I've had several instances of websites thinking they are smarter than me like this recently when trying to do security questions. Apple just recently made me pick 3 security questions. One of the options for the first question was "What was your first car". The third question option was "What was your least favorite car?". It wouldn't let me have the same car for both. Really Apple? My least favorite car WAS that car!!

 

Hold on a minute! Are you trying to say that Apple, of all companies, would actually implement some type of limiting ability and would think it was prudent or even preferred? Heck they might even refer to some such implementation as a "feature". I mean, c'mon, Apple and particularly it's user base are the epitome of humbleness. It's as if you might be implying that Apple would, in some way, be a little arrogant in thinking it is superior.

I love my iPhone, hate all other Apple products. (Well I guess the iPad isn't bad, I got a TouchPad instead). My husband has a Mac and I refuse to use it.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340708
Share on other sites

Hooray, an apple complaint thread!

 

Every single apple product, when a button is pushed, does what Apple believes you really meant.  They take form over function to the logical extreme.  My iPod doesn't pause or skip tracks when I hit the pause button if I've hit the center button in the last 15 seconds (because it refuses to affect the track in anything other than "volume control" mode). 

 

I had a mac for a long time when OSX first came out, and I couldn't get used to it.  It just never did what I wanted it to do, it always got really close.

 

I tried to switch to the iPhone, I borrowed one and used it for a few days.  It just doesn't let you do what you want to do.  I understand their design philosophy insists that everything be perfect, but what if I want an imperfect feature, or I want to install my own stuff?  Maybe Jesi doesn't want turn by turn GPS, a text terminal, or the ability to play internet radio while using an NES emulator, but all of those things I do every day.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340766
Share on other sites

Well I don't want those things on my phone, no.

I've had 3 iPhones and will get the next one that comes out. I'm a creature of habit. My phone before the iPhone was a Razr. When it broke my at-the-time SO had an iPhone and I hated it. I tried like 5 other smart phones from AT&T (what they had at the time sucked of course) and eventually used his iPhone and gave in and got one. It's perfect for what I want to do on my phone. Just like a Windows PC is perfect for me for what I want to do on my laptop or desktop. The TouchPad is close enough for what I want in a tablet.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340768
Share on other sites

I wonder if you'd be less happy with your iPhone after using an android phone for a while.  There's just so much more I can do.  Do you have a standalone GPS?  That's usually the selling point for people, I can actually push a button and say "Navigate to Susan's home" and the lady starts telling me where to turn.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340772
Share on other sites

I had a GPS a few years ago but it got stolen. I've never needed turn-by-turn, I just look at the map and know which way to turn... I've always found speaking GPS systems to be annoying. My husband and I used one for a few days on a road trip and both hated it, we both prefer to look at the map and know the route ahead of time rather than have someone tell us constantly which way to go. I personally think those things are over rated, but that's just me. and him lol.

 

Actually I think my car comes with a GPS...I just never use it.

 

I've tried using my parent's andriods as well as ones my husband's work gives him and I don't like them.

 

I don't want to do more with my iPhone than what it currently can do. I don't even use a lot of the features it has.

Actually I take that back - I want to be able to adjust the brightness quickly. But everything else is perfect ;)

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340774
Share on other sites

I don't want to do more with my iPhone than what it currently can do. I don't even use a lot of the features it has.

Actually I take that back - I want to be able to adjust the brightness quickly. But everything else is perfect ;)

 

Jailbreak it. A JB app called SBSettings (I haven't used an iPhone since 3G, so there might be a newer app) allows you to slide your finger across the top infobar (with the battery life, singal etc on it). It then shows a popup that let's you change a bunch of configurations. One touch toggles for wifi/edge/3g etc, and a slider for brightness. Tons of other crap too.

 

If they actually built and iPhone without the intention of abandoning it at most 1 year after it's release, I'd probably buy another.

 

The fact that an iPhone 3GS could output sound in mono, but my 3G with the 'same' firmware couldn't was one of those breaking points for me. Listening to The Beatles, etc. with one ear-bud in sucks.

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340790
Share on other sites

I don't want to do more with my iPhone than what it currently can do. I don't even use a lot of the features it has.

Actually I take that back - I want to be able to adjust the brightness quickly. But everything else is perfect ;)

 

Jailbreak it. A JB app called SBSettings (I haven't used an iPhone since 3G, so there might be a newer app) allows you to slide your finger across the top infobar (with the battery life, singal etc on it). It then shows a popup that let's you change a bunch of configurations. One touch toggles for wifi/edge/3g etc, and a slider for brightness. Tons of other crap too.

 

Thanks, I'll check that out!

Link to comment
https://forums.phpfreaks.com/topic/261595-formatting-surname/#findComment-1340795
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.