Thread: Get value

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2

    Get value


    Hi,

    How to get 8pp from "A4 Heavy Self Cover Booklets 8pp" using php?

    Thanks
    Sarath_PHP
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,007
    Rep Power
    9398
    Be more specific. Is it the "*pp" you're looking for? The last word in the string? Something that starts with a number? The sixth word? The only word with three characters? A word that contains both a number and two repeated letters?

    Comments on this post

    • ManiacDan agrees
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2
    Hi requinix,

    Yes, iam looking for *pp.

    Example1: A4 Heavy Self Cover Booklets 8pp
    Example2: A4 Heavy Self Cover 16pp Booklets
    Example3: A4 Heavy 8pp Self Cover Booklets

    How we get *pp using php?
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,871
    Rep Power
    6351
    PHP Code:
    $str 'A4 Heavy Self Cover Booklets 8pp ';
    preg_match('/\d+pp/i'$str$foo);
    $pp $foo[0]; 
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2
    Hi ManiacDan,

    Thanks ManiacDan. I got it.

IMN logo majestic logo threadwatch logo seochat tools logo