lovezbs
V2EX  ›  PHP

显示 V2EX 用户头像的程序

  •  
  •   lovezbs · Jun 19, 2015 · 2949 views
    This topic created in 3979 days ago, the information mentioned may be changed or developed.

    * PHP 代码 如下:*

    <?php
    for($i=1;$i<400;$i++){ 
                $id=$i;
                $md5_string=md5($id);
                $first_string=substr($md5_string,0,4);
                $second_string=substr($md5_string,4,4);
                // echo "id : ".$id."<br/>";
                // echo "md5_string : ".$md5_string."<br/>";
                // echo "first_string : ".$first_string."<br/>";
                // echo "second_string : ".$second_string."<br/>";
                $url="http://cdn.v2ex.co/avatar/".$first_string."/".$second_string."/".$id."_"."large.png";
                // echo "url : ".$url."<br/>";
                echo  "<img src='".$url."'/>";
           }
    ?>
    

    效果预览图

    2 replies
    kisshere
        1
    kisshere  
       Jun 19, 2015 via Android
    这些都是元老级别的人了
    run2
        2
    run2  
       Jun 20, 2015 via iPhone
    高级黑
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3789 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 10:36 · PVG 18:36 · LAX 03:36 · JFK 06:36
    ♥ Do have faith in what you're doing.