php

PHP: Array acting strangely in foreach

Hi, I have a class that is query data via a SOAP client. the results of the query are returned as an array of objects. Something strange is happening. I'm not sure if it only occurs when there is one element in the array. Here is the code: function getNotes($ticketid){ $ticketid = $this->ms_escape_string($ticketid); $conn ...

Zend XMLRPC Array Depth

Does anyone know if it is possible to change the max depth of an XMLRPC response array for a Zend_XmlRpc_Server? I am returning the following without a problem: $response = array('level1' => array('level2' => array('level3'))); but as soon as I do this it fails: $response = array('level1' => array('level2' => array('level3' => array(...

How copyscape uses google API

How copyscape uses google API? The ajax api works only on browsers with javascript enabled, So this api is not used. The SOAP api is not used, because it is not allowed to be used for commercial use and no more than 100 queries are allowed per day. ...

Whats the difference between a front controller plugin and an action helper?

Possible Duplicate: Zend Framework: Controller Plugins vs Action Helpers I know what the difference is technically, and how to register a front controller plugin/action helper, but it would really help me if someone with more experience in zend framework could explain me the different use cases for the two (examples would be g...

Enabling propel plugin in Netbeans for Symfony Php framework

I am new to Symfony framework. I got Symfony (v1.4.8) on my Netbeans 6.8 and also got the initial success page. Now, I want to Configure a database using Propel ORM Tool. But in Netbeans I am getting Doctrine as the default tool enabled. I am not even getting the PROPEL commands in my Run Commands window. I configured Netbeans for Symfo...

Accessing array object variables when implementing RecursiveArrayIterator in RecursiveIteratorIterator

I have a large arrayObject which I'm looping over using the following:- $rit = new RecursiveIteratorIterator(new RecursiveArrayIterator($hierarchy)); foreach($rit as $key=> $val) { } How can I access the a specific key within the array? I can access them by echoing $key and the $val but I have specific keys I wish to access. If I att...

html to image using PHP

Hi, I am looking for best solution to convert HTML to Image using PHP (on LINUX), please post your suggestions .... ...

SOAP fault: object not set to an instance of an object

I found this question on here: http://stackoverflow.com/questions/927566/php-soap-issue-server-was-unable-to-process-request-object-reference-not-s I have a similar issue, only the WSDL is private, so I figured I'd try and get a basic timezone SOAP Client working. The solution in the other question isn't possible for me to use with th...

How can I go to history.back() when page loads?

Hi, I have a PHP page that has an error, but if I go back, it works fine. I can't redirect because the page can be accessed from two different places. How can I make a JavaScript that loads automatically when the page loads? Thanks, Sebastian EDIT that wouldn't work. is there a way to get the url of history.go(-2)? thanks, Sebastia...

How can I convert an object to associative array in PHP?

As title suggests, My question is that how i can convert a php class to an associative array? For example I've class MyObject { private $size = null; private $length = null; private $width = null; public function getSize(){ return $this->size; } public function setSize($size){ $this->size = $size; ...

which is best, either fetching from another PHP file or from mysql db in PHP?

i have a module called online events in my website, this module will run for every 8 sec and fetches a recent activities in my websites. So, if more than 100 users are using my website at a time, it consumes more memory and more cpu usuage. what should i do to reduce cpu usage and memory, provided it should not affect a online events mod...

Make TIMESTAMP column update even though I didn't change anything?

I have a MySql table which has a timestamp column. The table also has alot of other columns. I have a "change classified" section on my page. When users change their classifieds, I want the timestamp to update its timestamp. And it does, but sometimes you don't change a classified at all, you just want it to be "renewed". How can I m...

Have PHP dump heap on OutOfMemory exception

I am currently debugging a script that constantly runs into OutOfMemory exceptions. It is run as a cronjob and usually runs fine, but when the cronjob wasn't run for a while (for whatever reason) the script has to handle to many elements that queued up and will run into a OutOfMemory exception. From examining the code I was not able to ...

best way to check a empty array?

hello! how can i check a array recursively of empty content like this example Array ( [product_data] => Array ( [0] => Array ( [title] => [description] => [price] => ) ) [product_data] => Array ( ...

How can you tell if a site is using oscommerce?

Is it possible to tell from the page source of a site whether it is built using oscommerce? I've looked a t a couple of sites and can't see an obvious way but I was just wondering if there was a common folder naming convention or something like that which would give it away? ...

Help with regex for commas in sql query

Hi, I have a SQL query like: select column1 as a, DECODE(x, 1, x1, 2, x2) as column2, DECODE(y, 1, y1, 2, y2) as column3 from test And I want to select the following commas (denoted with **,**): select a as column1 **,** DECODE(x, 1, x1, 2, x2) as column2 **,** DECODE(y, 1, y1, 2, y2) as column3 from test I am using /(?!(...

Drupal module menu item not showing in menu primary-links

I'am trying to get a menu item to show in the 'primary-links'. i've read this, but that is not working. What am I doing wrong? /** * Implementation of hook_menu(). */ function modulename_menu() { $items = array(); $items['test'] = array( 'title' => t('test'), 'description' => 'some description', ...

Garbage after JSON - PHP Array problem YQL

Hi, i'm using YQL to send data back to an iPhone app i'm developing. I've got a JSON parser on the iphone and a PHP page on my webhost. This is the PHP: <?php header('Content-type: application/json'); $arr = array(); $result = $_GET["q"]; $yql_base_url = "http://query.yahooapis.com/v1/public/yql"; $yql_query = "select * from ...

showing new window pop up to center

function open1() { window.open('http://www.pageresource.com/jscript/jex5.htm','ddsfa','width=400,height=200'); } Hello I want show this popup to center when click on "Hello" ...

$_POST is empty when using AJAX (Prototype)

Hi. I am fairly new to PHP and I am experiencing a problem that I can't find an answer to anywhere!! It really bugs me... I want to post data to a PHP script using AJAX. I am using the JS framework Prototype to do AJAX communication. Here is the JS code: new Ajax.Request("/ondemand/Radio.php", { method: 'POST', par...