FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » change a string where have number after a word
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: change a string where have number after a word [message #180355 is a reply to message #180348] Tue, 05 February 2013 19:30 Go to previous messageGo to previous message
Salvatore is currently offline  Salvatore
Messages: 38
Registered: September 2012
Karma:
Member
On 2013-02-05, nawfer <novalidsforspam(at)alt(dot)al> wrote:
> for to complete the code
> if I have
> "arts color 4, tested well 4, passenger 2, arrived 2"
>
> or
> "arts color bb 4, tested well 4, passenger 2, arrived 2"
>
>
> extract this
> "arts color bb 4, tested well 4"
>
> at moment extract so
> bb 4, well 4,
>
>
> and also how have this
> "arts color bb, tested well"

In that case, I would do the following:

1. Explode the string using "," as the delimiter.
2. Remove any array elements in the split string that do not match /\s4$/.
3. Implode the string.

--
Blah blah bleh...
GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: script php with <img scr...../>
Next Topic: classes in PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 09:29:01 GMT 2024

Total time taken to generate the page: 0.04961 seconds