1
attock
PhP String: Trmi all before match
  • 2007/6/20 21:11

  • attock

  • Not too shy to talk

  • Posts: 138

  • Since: 2006/8/20


how to trim every thing until a match within a php string.

e.g.
$x = "I would like to trim every thing until here okie"

and the output should be " Okie"

thanks

2
zyspec
Re: PhP String: Trmi all before match
  • 2007/6/20 23:49

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


You could do it this way...
$x "I would like to trim every thing until here okie";
$newstr ucfirst(stristr($x,'okie'));

$newstr now contains Okie...

3
BlueStocking
Re: PhP String: Trmi all before match

PhP String: Trmi all before match

by attock on 2007/6/20 16:11:49

how to trim every thing until a match within a php string.

e.g.
$x = "I would like to trim every thing until here okie"

and the output should be " Okie"

thanks


__________
e.g.

$x = "I would like to trim every thing until here okie"

and the output should be " Okie"

__________
Something is missing... like maybe the some code.
Please clarify, Thank you... BlueStocking

EDIT ADDON: @zyspec

$newstr = stristr($x,'okie');
Thanks, now that makes sense. Thanks...
hhttps://xoops.org/modules/repository .. It is time to get involved - XOOPS.ORG

4
attock
Re: PhP String: Trmi all before match
  • 2007/6/21 12:01

  • attock

  • Not too shy to talk

  • Posts: 138

  • Since: 2006/8/20


thank you ~
i'll give it try

Login

Who's Online

349 user(s) are online (262 user(s) are browsing Support Forums)


Members: 0


Guests: 349


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits