dqg17080
dqg17080
采纳率0%
2013-08-04 21:00

在PHP中获取onclick元素

已采纳

I have next html source:

<a id="smallphot1" style="cursor:pointer;" title="Mobile phone / smartphone Samsung Galaxy S Duos S7562 - gallery" onclick="loadPhoneSmallImg('phot1', 'http://localhost/02_samsung_galaxy_s_duos_s7562.jpg', 'http://localhost/', '_samsung_galaxy_s_duos_s7562.jpg' , '250px', '450px','4')"><img src="http://localhost/02_samsung_galaxy_s_duos_s7562.jpg" alt="Photo Samsung Galaxy S Duos S7562" border="0"></a>

and all I want is to get http://localhost/02_samsung_galaxy_s_duos_s7562.jpg

Is there possible to do this via PHP?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • dongzhan2461 dongzhan2461 8年前

    If you want to fetch the URL, you can do that using this code:

    $parts = explode("', '", $your_html);
    
    // http://localhost/02_samsung_galaxy_s_duos_s7562.jpg
    echo $parts[1];
    
    点赞 评论 复制链接分享
  • duanrong3308 duanrong3308 8年前

    In javascript you can hide a DIV tag:

    <a href="#" onclick="document.getElementById('test').style.visibility = 'visible'">test</a>
    
    <div id="test" style="visibility: hidden">
     <img src="image.jpeg" />
    </div>
    
    点赞 评论 复制链接分享

相关推荐