preg_match quastion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kirill_uk@hotmail.com

    #1

    preg_match quastion

    Hi All, wondering if someone could help me with this.
    I have a variable $var="blh blh blah bldd erter etert";
    i need to get first three words from it so basically i have to
    ,somehow, count first three spaces and get "blh blh blah" to a new var.
    Any idea?
    Thank you all!

  • d

    #2
    Re: preg_match quastion

    <kirill_uk@hotm ail.com> wrote in message
    news:1141612600 .759943.298690@ e56g2000cwe.goo glegroups.com.. .[color=blue]
    > Hi All, wondering if someone could help me with this.
    > I have a variable $var="blh blh blah bldd erter etert";
    > i need to get first three words from it so basically i have to
    > ,somehow, count first three spaces and get "blh blh blah" to a new var.
    > Any idea?
    > Thank you all![/color]

    $first_three=jo in(" ", array_slice(exp lode(" ", $var), 0, 3));

    if you want to do it without preg_match :)


    Comment

    Working...