php5

Compare and merge two word documents using php

Hi All, I am doing a project on online medical transcription training. For that we are not allowed the original documents to the users. User must type all the contents he hear and he uploads the documents to the server. Then the Original document will be compared or merged to his edited document and the result file will be downloaded t...

PHP Checkboxes in an array

All, When a form gets posted, I get some checkbox values like the below: Array ( [chk0] => true , [chk1] => true, [chk3] => true, [chk1002] => on, [chk1005] => on ) Using PHP,How can I construct a JSON request like this by using the above variables? "data": [ { ...

PHP OOP Design for simple Models

Hi, i've a little problem with the proper design for some simple database models. Lets say i have an User Object with getter/setters and an read method. Read querys the database and sets the properties. class User extends MyDbBaseClass { protected $_id; protected $_name; public function setId($id) { $this->_id = $id; } public funct...

How to save an XML file on server with haXe PHP?

I am just starting out with haXe development, and wanted to give the PHP side a go, but am already a little confused. What is the best way to save some form data to XML files in a folder on a server with haXe compiled to PHP? ...

Zend_Db_Table Using different Connection-Adapter for reading and writing

Hi Folks, In a current ZF project i have to use diffrent DB Connections for reading and writing. My approuch was do this by extending Zend_Db_Table_Abstract (and Zend_Db_Table_Row_Abstract) It looks like this at the moment: class SomeNamespace_Db_Table extends Zend_Db_Table_Abstract { /** * @var Zend_Db */ protected $read = NULL; ...

suggested ways to import various pipe delimited file into a db based around buffer table using php/mysql?

Hi I am trying to import various pipe delimited files using php 5.2 into a mysql database. I am importing various formats of piped data and my end goal is to try put the different data into a suitably normalised data structure but need to do some post processing on the data to put it into my model correctly. I thought the best way to do...

Jquery UI Checkboxes - Check category only if all subcategories are checked.

Hi, I have the following code. I need help fixing it such that the "Category" checkbox for each category should be checked only if all the items under that are checked. Thanks <html> <head> <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script> google.load("jquery", "1.3.2"); google.load("jqueryui", "1.7.2"); </script...

Files are getting corrupted via FTP Client Upload

I tried uploading files to my server my.php (normal local file) <?php $box_title= "SEARCH ME" ?> After uploading via FileZilla FTP Client (remote server file) // SOMETIMES ABOVE FILE BECOMES <?php$box_title= "SEARCH ME"?> // OR SOMETIMES LIKE THIS <?php $box_title= "SEARCH ME" ?> I suspect this is a server related issue, but no...

Getting parameter names from SOAP request with PHP SOAP extension?

Given that the following client.php creates this request XML: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soap.dev/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas....

Modify smarty object by reference

Hey Guys, I am having an issue modifying a smarty variable by reference. Here is what I am trying to do: class foo { $property; public function getProperty(){ return $this->$property; } public function index(&$smarty){ $smarty->assign('test',$this->getProperty()); } } $smarty = new Smarty(); $foo ...

PHP: Why Many Types of String Types And Multiple Implementations Of functions?

Hello All, A number of people are unhappy with the current implementation where there are either too many different string types (binary, string, unicode) or the multiple implementations of many internal engine functions and helper functions. Minutes PHP6 Developer Meeting This is for the PHP gurus. Do we really nee...

How to use Zend_Cache Identifier ?

Hi Folks, i think iam getting crazy, iam trying to implement Zend_Cache to cache my database query. I know how it works and how to configure. But i cant find a good way to set the Identifier for the cache entrys. I have an method wich search for records in my database (based on an array with search values). /** * Find Record(s) * Re...

PHPIniDir broken under windows 7?

I had a server running on a windows xp machine using apache2 with php and mysql. I've recently upgraded to windows 7 and have been having trouble getting it to work. Apache works fine and php works, but I can't seem to get it to work with a php.ini file. When I set PHPIniDir to a directory with a php.ini file, the Apache service does NO...

PHP: Is there any particular difference between intval and (int)?

Hello, Is there any particular difference between intval and (int)? Example: $product_id = intval($_GET['pid']); $product_id = (int) $_GET['pid']; Is there any particular difference between above two lines of code? ...

Interview: Tricky Questions

Hello There, What tricky questions can you suggest to ask an interviewee about PHP? I suspect there can be much to be asked from micro-optimization tips and probably questions related to dealing with deep nested arrays. Let's suppose, we are looking for a good php developer. What can be the trickiest questions to ask him? Thanks for ...

Common PHP Coding Pitfalls

Hello There, What can be the common PHP coding pitfalls which probably many of us are not avoiding? ...

What exactly is late-static binding in PHP?

Hello, What exactly is late-static binding in PHP? ...

PHP: Is ReflectionClass future-compatible?

Hello There, I have been using the cool reflection class in my framework. I wonder whether or not ReflectionClass is future-compatible? For example, in PHP5.3 or PHP6. Thanks ...

PHP: What is the difference between an interface and abstract class?

Hello all, What exactly is the difference between an interface and abstract class? ...

Huge performance decline when accessing object in associative PHP array

I'm seeing a huge performance decline in a (command line) PHP script, caused by a simple assignment (runtime increase from 0.8 ~ 0.9 seconds to 29.x seconds). The script first fetches a lot of data from a MySQL database and creates objects of different custom classes. After this fetching (php now uses around 500 MB of RAM) I loop an arr...