PHP警告:strpos()期望参数1为字符串,给定数组

In this question, I see where the $handle = @fopen($thumb, 'r'); was changed to $handle = @file_get_contents($thumb); because he needed to use file_get_contents for a string.

I am getting the same error but I do not see a fopen() element that needs to be changed? Where does this need to occur?

} elseif( strpos($post_id, 'user_') !== false ) {

    $user_id = str_replace('user_', '', $post_id);
    $user_id = intval( $user_id );

    $v = get_user_meta( $user_id, $field['name'], false );

    // value is an array
    if( isset($v[0]) ) {

        $value = $v[0];

    }

From the error $post_id is an array. An example of strpos

$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);

In your code print_r($post_id) to see containing values

 strpos($post_id, 'user_')//here $post_id is array

Function strpos() is used to compare strings and you have passed an array as the first parameter.

$post_id may be an array.