Questions for php


5688

Rewriting urls with mod_rewrite - GET variables

I found out I could make clean urls with mod_rewrite. I managed to make pages like /home.php viewable by visiting /home (without .php).
1623

How to figure out where this database insertion and retrieval is breaking?

Problem solved...variable undefined. I will add full answer when stackoverflow allows me to answer own question
8946

How to use an XML string to find certain element values in php?

How to use an XML string to find its certain element values?
7343

Compress and download from 3rd party ftp server using php

I'm downloading files from 3rd party ftp server using php. But file is more then 15mb. So it took more time to download. I have an idea to compress and download on the fly from ftp server. Is it po...
8906

defining an initial variable in a new object in php

I am new to OOP so forgive me if my question is flawed.
9515

Files showing up in terminal run, not in browser

I'm trying to list the files in a directory, but only the HTML portion of the page shows up in my browser. When I run the page through the PHP terminal interpreter, all the files are listed with the
1977

How to create a custom drupal cms from starting

Actually i need to know how and where the page content for each drupal page comes. So i tried to integrate my own custom theme to drupal. In the tutorial they are saying like i need to create a cus...
8910

Problems iterating PersistentCollection

I'm new to Doctrine and I'm having an issue iterating over a PersistentCollection, I have some basic entities set up with a ManyToMany relationship:
431

splitting multi-line email address entries

I'm having problems with splitting an array correctly. I have a textarea input that allows for multiple email addresses to be entered one per line. Once entered I'm turning this into an array and ...
7415

decoding Timestamps explicitly encoded in a filename

Quite a while ago I decided to change the way filenames are formatted when users upload a file to my website(which was a great idea!) to include the UNIX_Timestamp in the filename, this proved very
6400

Text formatting doesn't appear in emails that have been formatted using TinyMCE and sent using SwiftMailer

I use SwiftMailer in my PHP scripts to send emails and I use TinyMCE as a text editor to write and format the message body. The problem is that when I send the message it appears without any format...
6695

PNG Transparency with PHP

Hey having some trouble trying to maintain transparency on a png when i create a thumbnail from it, anyone any experience with this? any help would be great, here's what i am currently doing:
2090

Dynamically populate two dropdown menus

I'm not (as I am certain you'll notice below) a programmer or coder. I write network documentation manuals.
9284

How to refactor PHP to help improve SQL Server speed?

I've been tasked with finding a solution to some performance issues we've been having with our PHP web application (basically, we're reaching a "failure" point when combining high-volume users with...
9827

Why does array_unique sort the values?

This refers to one of my previous questions: array_unique vs array_flip - This states that array_flip(array_flip()) is much quicker than array_unique() when dealing with simple strings and integers.
3283

UTC clock based on server time?

I have a JavaScript clock that gets the time in UTC, it currently works, but the time is based off the client's computer. What could I do to base the time off of the server instead? I am using PHP ...
5448

Symfony2 efficient displaying list of categories and related products

I've got object Category and Product relation (one-to-many). I want to display list of all categories and objects related to them. If I use:
6723

Only allow English characters/letters/numbers and a few special characters

My problem is that I am making a small search engine from scratch, but it gets messed up if I search in Russian/any other language besides English. I was hoping some one could give me a code with r...
3910

Add values to an array after isset()

I'm trying to add elements to an array after subsequent trials, but so far only one value is being added to the array. I've Googled and searched stackoverflow, and I seem to be getting only half the
2219

Zend Framework Database Transaction - Can't rollback

Alright, let me get this out of the way first. My question is similar to this:
8717

How can an HTML page extract parameters passed through a form?

My question is should I convert two html pages to php pages, so the called page can access its POSTed parameters, or is there a way for a called html (.html extension) page to access posted paramet...
1692

Trouble with $.post

I am trying to insert some values into an sql database.
1942

In PHP, how do I check if a function exists?

How can I check if the function my_function already exists in PHP?
7549

Alternative Web file explorer/Navigator

I've found this online file explorer called enCode eXplorer. It was just what I was looking for; a simple, clean, free, easy-to-edit system, completely made up of one php file. The only problem I h...
1331

What is the difference between CURLOPT_SSLKEY and CURLOPT_SSH_PRIVATE_KEYFILE?

I was looking at this question and, to try to find the mistake, went to the PHP manual where I seen those 2 options :
1003

Get itunes id from url

what is the best way to retrieve id from itunes app link?
2027

extract some html with preg_match

i use preg_mach for extract some html ( i try to use DOMDocument but i had some problem with new line )
6425

Drupal overriding existing option list values

Currently entityreference do not support filtering (via views like references). I have to filter the returned result of option lists manually via hook_form_alter.
6663

MySQL- Unable to jump to row 0 on MySQL result index

I have got an old site that has recently been displaying an error which is weird as its been untouched for some time. I get the following:
6446

for loop with assignment in php

When I want to iterate an array I usually do:
8395

now(); and date(); function in code igniter give zeros result

So i want to insert current time to mysql database, this is my code :
4777

Show cumulative totals in new column

I am working on a simple flow statement where the user inputs +ve and -ve values and they are stored in a single table.
515

Translating a Perl reference to OO PHP?

So I tripped across another oddity in translating the old developers Perl script into
2379

Regular Expression only allow alphanumeric plus other specific characters

With a PHP function I'm trying to create a RegEx string for preg_replace that will only allow alphanumeric characters plus ! @ # $ % & . ,
1396

TCPDF not formatting

I'm using an ajax call to print a pdf and email it to user, but the problem is that the data in the pdf is not formatted.
3199

php - simpledb - can't get consistent read to work

I'm using AWS SimpleDB for my site, however if I udpate an attribute with something completely different, searching that property with either the new value or the old value are both returning the s...
4292

How to replace “{* foo *}” with nothing?

I want to replace all text what start with "{" and end with "}" including those "{" and "}". Text between them may be anything. =(
2236

How to do autorendering in Symfony

I'm guessing its just not done since I can't find any reference to this anywhere, even people asking without response. Although I'm hoping Symfony calls it something else.
8571

Get request host in PHP

I'm developing a website by Zend.
3773

How to ‘convert’ any given regex to a PHP `preg_match`-compatible regex?

Okay, this may be a dumb question, but I’m pretty new to regular expressions and I honestly have no idea how to do this.
3614

Regular Expression: Why am I getting matches here when I expect none?

I've a regular expression that's looking for 2-3 upper case letters, together, ending in T and beginning with P, M, C or E. The regular expression, executed in PHP, looks like this:
6445

Correct input values of strtotime

I want to convert a date by the following statement
9921

error while loading wordpress post using ID

I am trying to retrieve the content of a wordpress post using its ID:
3936

How to get data from multidimensional array by ommiting one column?

I am storing info in an array in a loop like that:
2997

Converting a querystring into an associative array

In PHP, I need a function to convert a querystring from an URL, say: http://example.com?key1=value1&key2=value2 into a PHP associative array : array ['key1' => 'value1', 'key2' => 'value2...