hello
i want to seperate a string,
i mean if a value passed in the form like srb123 34rb5
i want a function who can seperate a string and integar and echo it seperately
like (srb ) and (123) first example
like (345) and (rb) second example
i am waiting for the reply
thanks
shoaib
seperating a string
Moderator: General Moderators
- prometheuzz
- Forum Regular
- Posts: 779
- Joined: Fri Apr 04, 2008 5:51 am
Re: seperating a string
If you're not familiar with regex, I wouldn't use it.shoaib wrote:hello
i want to seperate a string,
i mean if a value passed in the form like srb123 34rb5
i want a function who can seperate a string and integar and echo it seperately
like (srb ) and (123) first example
like (345) and (rb) second example
i am waiting for the reply
thanks
shoaib
If you are familiar with it however, please ask a specific question about it. I mean, now it just looks like you're trying to find someone to do your (home) work. The saying "learn a man to fish instead of feeding him" applies here nicely, IMO.
So, if you post what you have already tried yourself and explain what went wrong with it, I'm more than happy to give you a hand with it. But, you can also just ignore me and wait for someone else to hand you a copy-and-paste answer. You decide!
Good luck!
Re: seperating a string
buddy i new to php i m learning it but i m stuck here if have tried different loops but simply don't get the result .
i just want to know the way how to do it.
thanks for the reply
i just want to know the way how to do it.
thanks for the reply
prometheuzz wrote:If you're not familiar with regex, I wouldn't use it.shoaib wrote:hello
i want to seperate a string,
i mean if a value passed in the form like srb123 34rb5
i want a function who can seperate a string and integar and echo it seperately
like (srb ) and (123) first example
like (345) and (rb) second example
i am waiting for the reply
thanks
shoaib
If you are familiar with it however, please ask a specific question about it. I mean, now it just looks like you're trying to find someone to do your (home) work. The saying "learn a man to fish instead of feeding him" applies here nicely, IMO.
So, if you post what you have already tried yourself and explain what went wrong with it, I'm more than happy to give you a hand with it. But, you can also just ignore me and wait for someone else to hand you a copy-and-paste answer. You decide!
Good luck!
- prometheuzz
- Forum Regular
- Posts: 779
- Joined: Fri Apr 04, 2008 5:51 am
Re: seperating a string
No problem.shoaib wrote:buddy i new to php i m learning it but i m stuck here if have tried different loops but simply don't get the result .
i just want to know the way how to do it.
thanks for the reply
Re: seperating a string
Well, you could do it without regex if you want to. Loop over each character, do a ctype_digit check and fill two strings.shoaib wrote:buddy i new to php i m learning it but i m stuck here if have tried different loops but simply don't get the result.