Hello,
How can I best set up my PHP (LAMP) development environment so that I have development, staging and production servers. One-"click" deployment to any of those, as well as one-click rollback to any revision. Rollback should also rollback the database schema and data to how it was when that source code was current.
Right now I'v...
Where can I find a free, lightweight YUI-like compressor for PHP?
I am sure it will decrease the file size but will compressing PHP code boost its performance?
Is this the same thing as an obfuscator?
...
I run a site using the MODx Content Management System. What I'd like to do is set up a news feed on the front page, with a blog-style backend that supports the usual things (tags, categories, archives basically).
I've looked into the MODx plugins which provide this functionality (the deprecated NewsPublisher - which we use currently - a...
Is it possible to call a function from PHP using onsubmit from javascript? If so could someone give me an example of how it would be done?
function addOrder()
{
$con = mysql_connect("localhost", "146687", "password");
if(!$con)
{
die('Could not connect: ' . mysql_error())
}...
i am using mysql (5.0.32-Debian_7etch6-log) and i've got a nightly running bulk load php (5.2.6) script (using Zend_DB (1.5.1) via PDO) which does the following:
truncating a set of 4 'import' tables
bulk inserting data into these 4 'import' tables (re-using ids that have previously been in the tables as well, but i truncated the whole...
I have a function that automatically exports a table into a CSV file, then I try to attach that same file into a function that will email it. I have sent attachments using html mime mail before, but I was wondering if that created CSV file needs to be stored on the server first before attaching it to the email?
...
I have a MySQL database of keywords that are presently mixed-case. However, I want to convert them all to lowercase. Is there an easy command to do this, either using MySQL or MySQL and PHP?
...
After using array_unique, an array without the duplicate values is removed. However, it appears that the keys are also removed, which leaves gaps in an array with numerical indexes (although is fine for an associative array). If I iterate using a for loop, I have to account for the missing indexes and just copy the keys to a new array, b...
I've got a PHP script that needs to invoke a shell script but doesn't care at all about the output. The shell script makes a number of SOAP calls and is slow to complete, so I don't want to slow down the PHP request while it waits for a reply. In fact, the PHP request should be able to exit without terminating the shell process.
I've lo...
At the moment my code looks like this:
# Assign values for saving to the db
$data = array(
'table_of_contents' => $_POST['table_of_contents'],
'length' => $_POST['length']
);
# Check for fields that may not be set
if ( isset($_POST['lossless_copy']) )
{
$data = array(
'lossless_copy' => $_POST['lossless_copy']
);
...
When Xdebug is installed/enabled, standard PHP errors (when set to display in the browser) are replaced with more informative messages that include stack traces for each. Also, I've noticed that it also seems to improve output in other areas such as the var_dump() function, formatting/color-coding the output to make it more readable.
Ar...
I'm in the process of making my PHP site Unicode-aware. I'm wondering if anyone has experience with the mbstring.func_overload setting, which replaces the normal string functions (e.g. strlen) with their multi-byte equivalents (mb_strlen). There aren't any comments on the PHP manual page.
Are there any potential problems that I should b...
In PHP, I want to read a file into a variable and process the PHP in the file at the same time without using output buffering. Is this possible?
Essentially I want to be able to accomplish this without using ob_start():
<?php
ob_start();
include 'myfile.php';
$xhtml = ob_get_clean();
?>
Is this possible in PHP?
Update: I want to do ...
A prospective client wants to have a calendar feature on their website. They want the option to go edit this calendar to update the events. Does Word Press offer something like this?
...
I am trying to call a COM object from PHP using the COM interop extension. One function requires an OLE_COLOR as an argument? Is there any way to pass this kind of value from PHP?
I have tried passing a simple integer value with no success.
$this->oBuilder->Font->Color = 255;
...
I'm working on something that was built on a PC set-up using php and an ms access database. When I port the app to my MAMP environment, I get
Fatal error: Call to undefined function odbc_connect() in /path/to/index.php on line 37
line 37 looks like this:
return odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=myfile.mdb",...
I am using the following code:
<?php
$stock = $_GET[s]; //returns stock ticker symbol eg GOOG or YHOO
$first = $stock[0];
$url = "http://biz.yahoo.com/research/earncal/".$first."/".$stock.".html";
$data = file_get_contents($url);
$r_header = '/Prev. Week(.+?)Next Week/';
$r_date = '/\<b\>(.+?)\<\/b\>/';
preg_match($r_header,$data,$he...
Hi,
I have a regexp I'm using with sed, but now I need to make it work in PHP also. I can't use system calls as they are disabled.
$ cat uglynumber.txt:
Ticket number : 303905694, FOO:BAR:BAR: Some text
Case ID:123,456,789:Foobar - Some other text
303867970;[FOOBAR] Some text goes here
Case Ref: 303658850 - Some random text here - hos...
In a previous question, I asked about various ORM libraries. It turns out Kohana looks very clean yet functional for the purposes of ORM. I already have an MVC framework that I am working in though. If I don't want to run it as a framework, what is the right fileset to include to just give me the DB and ORM base class files?
Update:
I ...
open_basedir limits the files that can be opened by PHP within a directory-tree.
I am storing several class libraries and configuration files outside of my web root directory. This way the web server does not make them publicly accessible. However when I try to include them from my application I get an open_basedir restriction error l...