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

    Join Date
    Oct 2009
    Posts
    75
    Rep Power
    5

    How can I get the img src value form html string


    How can I get the img src value form this example

    Code:
    <img title=\\\"title\\\" src=\\\"http://i28.tinypic.com/2mcwnsp.jpg\\\" alt=\\\"alttext\\\" />

    I'm trying
    Code:
    preg_match_all('|<img[\s]+src[\s]*=[\s]*\"([^\"]*)\"|', $string, $matches);
    but it not working
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    Code:
    /src=\\\\\\"([^"]+)/i
    Is there something you're not telling us?

IMN logo majestic logo threadwatch logo seochat tools logo