小编Bri*_*hop的帖子

在非对象上调用成员函数getAttribute()

这是我得到的错误

Fatal error: Call to a member function getAttribute() on a non-object 
in /home/a4688869/public_html/random/index.php 
on line 45
Run Code Online (Sandbox Code Playgroud)

这是一张图片:http : //prntscr.com/5rum9z

该功能适用​​于前几张照片,但在显示几张照片后会中断。本质上,代码会生成随机的html。我使用cURL来获取html,然后使用函数对其进行解析,然后从站点中选择图像,然后重复该过程,直到获得5张图像为止。

我的密码

$original_string = '123456789abh';
$random_string = get_random_string($original_string, 6);
//Generates a random string of characters and returns the string
function get_random_string($valid_chars, $length)
{

    $random_string = ""; // start with an empty random string
    $num_valid_chars = strlen($valid_chars); // count the number of chars in the valid chars string so we know how many choices we have

    // repeat …
Run Code Online (Sandbox Code Playgroud)

php curl

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

curl ×1

php ×1