PHP Warning: Illegal String Offset attributes [duplicate] - php

This question already has answers here:
Illegal string offset Warning PHP
(17 answers)
Closed 8 years ago.
Can someone help me out please. My error log is getting blown up by this error and I cannot figure out why.
PHP Warning: Illegal string offset 'attributes' in xml.php on line 377
Here is the xml.php file > http://pastebin.com/SL8Kt7Zu

On the line 377 check if the index is set before trying to access it:
if(isset($v['attributes'])) {

Related

PHP Warning in Wordpress [duplicate]

This question already has answers here:
What does the PHP error message "Notice: Use of undefined constant" mean?
(2 answers)
Closed 2 years ago.
I keep getting these messages on my custom post pages on my wordpress site....
Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /home/customer/www/stayjam.show/public_html/wp-content/themes/flatsome-child/template-parts/portfolio/single-portfolio-sidebar-right.php on line 1
Here is my line 1 but I can't figure out what I need to do!
<?php#
get_template_part('template-parts/portfolio/portfolio-title', flatsome_option('portfolio_title'));
?>
I'm assuming the warning is given as undefined constant php due to the opening tag in your php file.
Try to ensure the file is enclosed with <?php ?> tags.

Warning: A non-numeric value encountered in handler.php on line 62 [duplicate]

This question already has answers here:
Warning: A non-numeric value encountered
(26 answers)
Closed 4 years ago.
Warning: A non-numeric value encountered in
/Applications/XAMPP/xamppfiles/htdocs/cmp255/Final/Change
Maker/handler.php on line 62
I keep seeing this error when I run my code.
This is line 62
$fiveC = 0.05 * $_POST['fiveCent'];
This is what its getting data from
<p>$0.05<input type="number" name="fiveCent" ></p>
Could I get any help?
I'd call floatval on your incoming POST parameter to cast that to a float value, whether its a string or float-like.
So try
$fiveC = 0.05 * floatval($_POST['fiveCent']);

A PHP Error was encountered array conversion [duplicate]

This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Closed 6 years ago.
Can you help how to solve this im new in Php codeigniter. this code that get error
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: controllers/employers.php
Line Number: 44
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/tedyaya/public_html/system/core/Exceptions.php:186)
Filename: helpers/url_helper.php
Line Number: 543
This error telling you that you are trying an array to convert in string..
For example
<?php
$a = array("Apple","Bnana");
echo $a;//Will give you same error
?>
But
<?php
$a = array("Apple","Bnana");
print_r($a);//Will not give you any error
?>
Use print_r/var_dump in your controllers/employers.php line 44.

I need assistance with eregi - preg_match [duplicate]

This question already has answers here:
How can I convert ereg expressions to preg in PHP?
(4 answers)
Closed 7 years ago.
I was getting the following error:
Deprecated: Function eregi() is deprecated in /home/herbalhe/public_html/admin/includes/auth.inc.php
So I searched and found that I should be using preg_match() instead of eregi(). So I made the changes and now I am getting this error:
Warning: preg_match(): Unknown modifier 'p' in /home/herbalhe/public_html/admin/includes/auth.inc.php
The code on that line is:
if (preg_match(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) ||
preg_match(".inc.php",$_SERVER['PHP_SELF']))
Any idea what I should now?
It should be:
preg_match("/\.inc\.php$/i", $HTTP_SERVER_VARS['PHP_SELF'])

Illegal string offset 'type' in extra.class.php on line 32 [duplicate]

This question already has answers here:
Illegal string offset Warning PHP
(17 answers)
Closed 8 years ago.
I am having following errors on my website; I am very new to WordPress not able to track issue.
Warning: Illegal string offset 'type' in /home/content/p3pnexwpnas03_data02/52/2259652/html/wp-content/themes/softwarefails/lib/php/extra.class.php on line 32
Warning: Illegal string offset 'type' in /home/content/p3pnexwpnas03_data02/52/2259652/html/wp-content/themes/softwarefails/lib/php/extra.class.php on line 32
extra.class.php
Code in fiddle
Error is all over the website, I am not able to upload any images it gives following error.
An error occurred in the upload. Please try again later.
$inputs['type'] probably doesn't exist test first if it exist before doing a string compare
This error is cause when you are trating the string as a full array. For eg
$fruit_counts = array('apples'=>2, 'oranges'=>5, 'pears'=>0);
echo $fruit_counts['oranges']; // echoes 5
$fruit_counts = "an unexpected string assignment";
echo $fruit_counts['oranges']; // causes illegal string offset error
Have a look here too

Categories