Skip to content

Tag: php

Unsupported operand types

I am working on a shopping cart function for a website and have stumbled across this error: Fatal error: Unsupported operand types in … on line xx I think this may be because I am performing some math between a variable and a value within an array. What I am not sure of is how to perform math on a

Convert XML to CSV with PHP

I’m using the following code to convert my XML file to a CSV format. Unfortunately, it seems to not be recognizing each entry in the XML and so the XML file ends up being blank. An example of my XML file is below… Any ideas what I did wrong? Answer Try this

Redirect /index.php – wordpress

I want that if someone got link to my site, lets say: www.bla.com/index.php , he will redirect to www.bla.com. or in another words – remove the index.php. Here is my .htaccess file: Either if someone got link: www.bla.com/camera/index.php – it will redirect to www.bla.com/camera/. For now, the sit…

Convert SQL results into PHP array

I’m fairly new to PHP and I’ve been looking around and can’t seem to find the specific answer I’m looking for. I want to make a SQL query, such as this: Basically I want to take the entire contents of the result and create an array that I can access in a similar fashion as the row. For…

Implode array with array of glue strings

I have a awkward need but I need to interleave an array with another array before imploding the result. I guess my better option would be less talk more example Array number one Array number two I need to produce My question is can I do that with an implode or I must build my own function? Answer Adapted from

Google Api PHP Client Library

I am trying to use the Google API PHP Client library for Google Analytic v3. I am able to run the simple app I wrote at home, but when I try at the office it doesn’t work. When I run the program I am asked to authorize the php app to my google account. After allowing access I get Google_IOException: