php

Consolidate an array in PHP?

I have an array that looks like the following: Array ( [0] => Array ( [id] => 10 [value] => 5 ) [1] => Array ( [id] => 10 [value] => 1 ) [2] => Array ( [id] => 11 [value] => 1 ) [3] => Array ( [id] => 11 [value] => 1 ) ) How ca...

Most efficient way to do language file in PHP?

Questions Updated instead of making a new question... I really want to provide a few alternative languages other then English on my social network site I am building, this will be my first time doing any kind of language translation so please bear with me. I am researching so I am al ear and open to ideas and I have a lot already here ...

How do I run all my PHPUnit tests?

I have script called Script.php and tests for it in Tests/Script.php, but when I run phpunit Tests it does not execute any tests in my test file. How do I run all my tests with phpunit? PHPUnit 3.3.17, PHP 5.2.6-3ubuntu4.2, latest Ubuntu Output: $ phpunit Tests PHPUnit 3.3.17 by Sebastian Bergmann. Time: 0 seconds OK (0 tests, 0 asser...

html tags in data returned from json

I have a php page that is returning some data in json. Basically I am doing echo on this page. The data being returned has some html tags. This is causing my jQuery code to break. Is there a way to clean up the data and strip off the tags before putting it in the json object? Furthermore, I am trying to display the data from json in...

File Structures -- Why use (Zend) MVC?

I'm relatively new to PHP and have been writing a project using what I believe is a fairly basic file architecture - all files and sub-folders within one main site folder accessed separately. Within the project, I've been using the Zend Framework as more of a library than an actual framework. I'm happy with Zend and using it like this ma...

Is header('Content-Type:text/plain'); necessary at all?

I didn't see any difference with or without this head information yet. ...

How to change background of TinyMCE ?

I have just install TinyMCE editor for my website. But the default background is black and text colour is gray. Anybody can tell me how to change background to white and text colour to black. Thanks you verry much. ...

help in php button

i have a this button <input type="button" name="continue" id="continue" value="Continue"> in php we use if($_POST['continue']) to edit the action of the submit button but only if its type is "submit". what if its type is "button"? how can i edit the action of that button? ...

Inserting raw (binary?) image data into mysql? (PHP)

I've got a raw/(binary?) image like this: ÿØÿà�JFIF��–�–�*!!!$'$ &(goes on forever); when i try to insert this into mysql it doesn't work, the column type is set to longblob, any ideas? ...

MVC framework for PHP

Possible Duplicates: What PHP framework would you choose for a new application and why? Whats your no framework PHP framework? I am thinking to use a MVC framework in php. I used codeigniter before for some of my project. Codigniter is light weighted compared to other framework. But it has less functionality compared to the ot...

putting php codes on onclick event of a button

<input type="button" name="continue" id="continue" value="Continue" onclick="<? if($_POST['rules']==null) { echo "hello();"; } elseif($_POST['rules']!=null) { echo "myRedirect();"; } ?>" > i have a form with a textarea. when the user hits the button when the textarea is null it should d...

Will all files be compressed by using ob_start("ob_gzhandler"); at line 1 with PHP?

<?php ob_start("ob_gzhandler"); ?> <script type="text/javascript" src="Util.js"></script> <script type="text/javascript" src="connection.js"></script> .... <?php ob_end_flush(); ?> Will the files included by or also be compressed? ...

How do you get a text box that becomes a pull down menu like in Yahoo Finance "Get Quotes"?

The first letter you enter creates a pull-down menu of all items in a database that start with that letter... ...

exporting to word file( *.doc ) in php

i have one php page which prints some information. Information is a table with some values dynamicaylly printed in table cells.Now instead of sending this page to browser i want the page to be exported to a word file.How can i do it? In short i have a page A.php . A.php contains a link to B.php. When the link on A.php is clicked i want ...

PHP/MYSQL grab data from of all matching fields

What is the propper syntax to grab data from of all the matching fields? This example outputs only 1 of the matching fields: $myvariable = "SELECT post_content FROM wp_posts WHERE post_name = 'testing' AND post_status = 'publish' AND post_type = 'post'"; echo = $...

regexp get filename from url

url: http://blabla.bl/blabla/ss/sd/filename How to get a filename? ...

Is it possible to use inline comments for .ini files with PHP?

Is it possible and safe to use inline comments for .ini files with PHP? I prefer a system where the comments are inline with the variables, coming after them. Are the some gotchas concerning the syntax to be used? ...

Save text form TinyMCE Editor to XML file?

I write an web page to load text form an XML file to edit on TinyMCE editor. But when i write xml it contain special character like this: &lt;p&gt;&aacute;dasd&lt;/p&gt; and when i try to read that XMl file again it break. Anybody can tell me how to fix that bug:(. Thanks you verry much. ...

PHP: Destroy an object from within the object?

Is there a way in PHP to destroy an object from within that same object? ...

Zend Framework 1.9.x and Firebug

Anybody here can point me on the right direction on using firebug for logging on Zend 1.9.x ? I am using this : (from Zend Framework Manual page) // Place this in your bootstrap file before dispatching your front controller $writer = new Zend_Log_Writer_Firebug(); $logger = new Zend_Log($writer); // Use this in your model, view and co...