Help " Warning: Illegal string offset"

Started on the old forum in November 2012 · view the original in the archive · old links redirect here

#coding #debug #error #php

2 replies · 509 views · started 14 years ago · 1 min read

3 participants
s3nzo Developer · 156 posts #1

Hello guys, i'm getting this error in PHP 5.4.* i've googled it seems the problem is to parse a string as an array, but with me that don't seem to be the case, i var_dumped it still can't figure it out please help, code is

static $arr;
if(is_array($var))
{
	foreach($var as $key=>$value)
	{
		$arr[$key]	= $var2->real_escape_string(htmlentities(trim($value)));//Problem line
		if(empty($arr[$key]))
			return false;
	}
}
arnage Lead · 811 posts #2

From where did $var2-> came from? It shouldn't be there.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
shushant Developer · 207 posts #3

is $var2 value is defined as object

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close