Ecommerce Shopify WordPress Discussion

PHP Warning: strpos() expects parameter 1 to be string, array given

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

January 27, 2024

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

January 27, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.