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
Tag: php
PhpStorm debugger not stopping at BreakPoints; keeps waiting for xdebug _SESSION_
Updated question : PhpStorm | WebMatrix (IISExpress) | Xdebug.remote_port | — Which Port(s) to put where? I’m running localhost web server on my Windows machine with WebMatrix and IISExpress. I’ve installed PHP and Xdebug in it and they both are working. I have a local WordPress install. I’m…
Execute an external program in php and return output file download link
I’m trying to run file_creator.exe via PHP which accepts some arguments and produces an output file. so how can I get the name of output file in order to produce the download link? Answer You will want to use shell_exec() function in PHP (http://php.net/manual/en/function.shell-exec.php) to run your exe…
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
Python is Garbling a Salt Generated from PHP and Stored in Mysql
I am exporting, by scraping it with http requests since the host won’t give me database access, a forum and importing it into a mysql database for vbulletin. In vbulletin users have unique password salts, and it generates password hashes using this algorithm: I’m using a python script to read stor…
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:
preg_match_all string from file with value
I need to search into file name lll.php about content of option by value as my file lll.php I try this code but not work with me my search code like n-7065 my file content value but it now work with me Answer