Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Explode at character type change
Old 10-14-2007, 09:13 AM Explode at character type change
mad_willsy's Avatar
Super Spam Talker

Latest Blog Post:
R&R Catering Hire Testimonial
Posts: 805
Name: Will Craig
Location: Cheltenham, Gloucestershire, UK
Trades: 0
I am working on a username suggester.

I would like to explode at character type change then ignore numbers and special characters to turn...

mad_willsy into array("mad", "willsy")
bob1 into array("bob")
SomeWierdUsername array("Some", "Wierd", "Username")

etc

Thanks...
__________________
Wont :P

Please login or register to view this content. Registration is FREE
mad_willsy is offline
Reply With Quote
View Public Profile Visit mad_willsy's homepage!
 
 
Register now for full access!
Old 10-15-2007, 03:56 PM Re: Explode at character type change
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Trades: 1
off the top off my head ... might have some small glitches in it

Quote:
$str = 'abCd_ef';
$i=0;
for ($j=0;$j<=
strlen($str);$j++){
$char=substr($str,$i,1);
$next_char=substr($str,$i+1,1);
if ($char=='_') {
$i++;
} elseif {
$words[$i].=$char
$curent_case= ( $char === strtolower($char) ) ? 'lower' : 'upper';
$next_case= ( $next_char === strtolower($next_char) ) ? 'lower' : 'upper';
if ($curent_case !== $next_case) $i++;
}
}
__________________
If you like my posts ... TK is appreciated:)

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Old 10-16-2007, 04:40 AM Re: Explode at character type change
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
1. preg_replace upper case letters with space and letter
2. replace all non-letters with spaces
3. preg_replace multiple spaces with single space
4. trim
5. explode
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Explode at character type change
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12208 seconds with 12 queries