php

php symfony and apache2 - inst't serving .phtml

Hi, I have a problem with apache2 settings (Ubuntu system). I would like to run symfony project on my localhost but instead of serving .phtml files, browser is trying to download files. this is my file .host: 127.0.0.3 test this is apache2/sites-available/default file < VirtualHost 127.0.0.3:80> ServerName test Document...

Zend Studio cannot detect Zend Server

PHP Version 5.3.1, Zend Studio 7.1.1.v20091227 Zend Server Community Edition 5.0 (Build: ZendServer-CE-5.0.0GA_RC181-5.3.1-Windows_x86) Apache/2.2.14 (Win32) mod_ssl/2.2.14 OpenSSL/0.9.8k Windows 7 Home Premium 64-bit I have installed Zend Studio, downloaded and installed Zend Server. Zend Studio does not automatically detect Zend S...

cross referenced tables from multi-dimensional arrays php?

how do it turn a multidimensional array like: $fruits['apples']['blue'] = 24; $fruits['bananas']['blue'] = 12; $fruits['apple']['red'] = 34; $fruits['gooseberries']['orange'] = 4; $fruits['oranges']['red'] = 12; into a cross referenced table like: Thanks! ...

PHP simpleXML parsing

I need currency conversion, euro to dollar. The European Central bank provides the rates here: http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml I can get the USD rate by using the first node, but what if they change the order? Do I need something more reliable? I have no idea how.. $xml = @simplexml_load_file('http://www.ecb...

Force freeing memory in PHP

Hi everybody, in a PHP program, I sequentially read a bunch of files (with file_get_contents), gzdecode them, json_decode the result, analyze the contents, throw the most of it away, and store about 1% in an array. Unfortunately, with each iteration (I traverse over an array containing the filenames), there seems to be some memory lost ...

PHP how to get revision number file in SVN

Say I have a file in a SVN. How do I use PHP to check the file's revision number? I see the SVN function list at http://www.php.net/manual/en/ref.svn.php but am not sure which one to use or the exact code to do it. Thanks! ...

PHP bitwise left shifting 32 spaces problem and bad results with large numbers arithmetic operations

Hello, I have the following problems: First: I am trying to do a 32-spaces bitwise left shift on a large number, and for some reason the number is always returned as-is. For example: echo(516103988<<32); // echoes 516103988 Because shifting the bits to the left one space is the equivalent of multiplying by 2, i tried multiplying the...

How do i Convert a Select to a Checkbox

That sounds pretty odd but i have this cod and i need to convert it to checkbox, with the same functionalities <select onchange="document.getElementById('reasonDiv{$test->id}').style.display = ''; document.getElementById('reason{$test->id}').value = this.value;" name='reasonId{$test->id}' id='reasonId{$test->id}'> <option value=''...

write php codes independent from template

How can I write php codes independent from XHTML codes? Thanks in advance ...

jQuery / Spry Validation / Problem

Hi Chaps, I have a PHP form with one input and a button. A jQuery script ('loading' animated gif) is triggered on the click of the submit button. I also have a Spry Validation field linked to the input. At the moment, if the validation is triggered, the animated gif continues and won't stop. The furthest I've managed to get with it, is ...

odd url, and difficulty in following the php page flow

I'm trying to understand code that I bought so I can modify it. In the index.php there are picture links: <a href="test10,10"><img title="" border=1 src="makethumb.php?pic=product_images/test101.jpg&amp;w=121&amp;sq=N" / ></a> I don't understand the href since it is not pointing to a page. test10 is an id of a picture. I assumed it ...

Kohana 3: Example of model with validation

I find examples and tutorials about models and about validation. And I places that say the validation (or most of it at least) should be in the model, which I agree with. But I can't any examples or tutorials that show how that should be done. Could anyone help me with a simple example on how that could be done? Where would you have th...

is there any way to hook a debug function into a hook such as init and retrieve every php function whose operates there ?

is there any way to hook a debug function into a hook such as init and retrieve every php function whose operates there ? what i meant with PHP function is its name ? is it possible to retrieve any php function name via php built in function ? ...

Get modified date via FTP using PHP / CURL

I seem to be running into a documentation drought with CURL vs FTP, can anyone tell me how to get the last modified date of a given file using PHP / CURL. Many thanks! ...

iPhone SDK Push notification randomly fails

I have a PHP file with the following content that works perfectly on development ceritficates, but when I switch to a production certificate the PHP errors and gives the below message, but it only does this about 50% of the time. The other 50% it works. Anyone know why this might be happening? <?php // masked for security reason $devic...

OOP beginner: classB extends classA. classA already object. method in classB needed.. etc.

Hey guys, I'm learning myself to go from function based PHP coding to OOP. And this is the situation: ClassA holds many basic tool methods (functions). it's __construct makes a DB connection. ClassB holds specific methods based on a certain activity (extract widgets). ClassB extends ClassA because it uses some of the basic tools in th...

Approach to mapping dictionary database tables to models in MVC

Hi, lacking a fellow programmer to talk over the right approach for my problem, I decided to ask you. What is your preferred approach of mapping dictionary tables to a model in MVC paradigm, regardless of the MVC framework / environment you are using? My problem is I have a couple of database tables that only serve as dictionaries and ...

PHP Redirect after execution of code

I have a php page that takes in a bunch of url parameters and sends out an email. I am trying to have this page call another web page using the same url parameters, after the mail is sent. If I do the following, will my email be sent reliably? Is a redirect what I really want to do? Update: Thanks for the tips. As you can see by my us...

Tool for converting subset of PHP code into Java/Scala/Groovy?

Do any exist? Ideally it would also come with a library of basic PHP functions. I have a bunch of simple PHP scripts (no extensions, no fancy dynamic hacks, etc) I'd like to convert to Java... It would be great if a tool could do 80% of the work while I do the other 20%. ...

Why no refactoring tools in PHP Eclipse? Do I need to install something?

I'm looking for the "Highlight code -> right-click -> Extract Method" type of functionality I see in Eclipse Java. Does this exist for PHP? ...