php error

On a web page I have a really esoteric php warning.  I have done a bunch of things to clear up the warning however to no avail.  Is there a way to out put an error so it gives me a robust report to help find what went wrong?  Something more robust than just:
error_reporting(E_ALL);
ini_set('display_errors', '1');
LVL 7
rgranlundAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gr8gonzoConsultantCommented:
There's a PHP extension called xdebug which can provide an automatic stack trace on errors (www.xdebug.org). That might help you better locate the source of the error.

Alternatively, you can just provide the error here and the relevant details and we can try to help walk you through it.
0
rgranlundAuthor Commented:
@gr8gonzo.  Thanks.  If I need more help I will post the url.  However, at this point it will take forever to explain how the whole thing works.  It is an warning generated by the CMS.
A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Template.php

Line Number: 3858

Open in new window


The php code being referred to:
		return str_replace(LD.$name.RD, $value, $string);
	}

Open in new window

I know that probably does not help though.
0
gr8gonzoConsultantCommented:
Is $name or $string an array?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

gr8gonzoConsultantCommented:
If $name is an array, then you can probably fix the warning by changing it to:

        foreach($name as $k => $v) { $name[$k] = LD.$name.RD; }
      return str_replace($name, $value, $string);
      }

This assumes that:
LD and RD are defined constants and you're trying to put them around each value in the array. So if you had an array like:

[0] = "John"
[1] = "Gonzo"

...and LD was "X" and RD was "Y", the you'd end up with:

[0] = "XJohnY"
[1] = "XGonzoY"

At this point, you should be able to use an array in str_replace without a problem.
0
Ray PaseurCommented:
Here is a code sample that may show the sort of thing that is happening.  The PHP script is using an array as if it were a string.  You can type-hint or test for this and avoid it, but more likely it is a logic error in the script, or some unexpected data that was not filtered before it was used in the script.
http://iconoun.com/demo/temp_rgranlund.php

<?php // demo/temp_rgranlund.php
/**
 * See http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28642896.html
 *
 * Demonstrate an inappropriate array-to-string conversion
 *
 */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);

// THE INITIAL STATE OF THE SELECTIONS
$selected = array
( 0 => 'selected'
, 1 => NULL
, 2 => NULL
, 3 => NULL
)
;

// FORCE A CONVERSION TO STRING
echo $selected;

Open in new window

0
rgranlundAuthor Commented:
" but more likely it is a logic error in the script, or some unexpected data that was not filtered before it was used in the script."  I'm sure it is this.  I just can't find where I made my mistake.  The code is part of a foreach so the first time it loops the warning is not there but the 2nd time, there is one warning.  the third time, there is 2 warnings and so on.  I'm trying to figure out a way to narrow down my search.  I thought that it may have to do with select choices and input fields but I can't find any mismatched.

Does this mean that if I am echoing out something that does not have a value, it will through an error?
0
gr8gonzoConsultantCommented:
Can you provide a URL with steps to reproduce those warnings?
0
rgranlundAuthor Commented:
goto: http://23.101.151.179/index.php?/store/
fill in all needed info, submit.  On next page, click add another bike.
Fill in info, submit.
This warning will only appear in FireFox, not Chrome.
0
gr8gonzoConsultantCommented:
I don't see that error appearing.
0
rgranlundAuthor Commented:
Are you using FF?
0
gr8gonzoConsultantCommented:
Yes. I did see some kind of HTTP error in the AJAX call going to the view cart, but there wasn't any content returned. I didn't see anything that resembled the error message you mentioned above.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgranlundAuthor Commented:
It seems to have disappeared.  I did not change anything at all.  However, I was able to look into the ajax error, which is good.  Thanks.  If it pops back up, I'll document how I made it happen.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.