php

How to "flatten" a multi-dimensional array to simple one in php?

It's probably beginner question but I'm going through documentation for longer time already and I can't find any solution. I thought I could use implode for each dimension and then put those strings back together with str_split to make new simple array. However I never know if the join pattern isn't also in values and so after doing str_...

What is the best way to persist PHP application setings?

I have a small application that I'm developing, that I may want to give/sell to others. I want to persist some settings, and create an admin interface to modify them. What would be the best way to store them away? A DB table seems like overkill for the 10-20 settings I'll have, and I want the retrieval of these settings to be as fast ...

Is putting a php script in the src of the image tag slower than normal and by how much?

If I put this tag in my HTML: <img src="http://server/imageHandler.php?image=someImage.jpg" /> instead of <img src="http://server/images/someImage.jpg" /> and use the imageHandler.php script to read the image file, output expire headers and print the image data, i expect it to be slower. Is this a viable way to manipulate image he...

Book recommendations: PHP/MySQL and Dreamweaver ?

I need a book that discusses PHP, mySql and Dreamweaver as I have a project and i don't know either of these technologies, so i need something to give me a headstart. ...

help in reading nested xml using xmlreader in php

<root> <thing> <specs> <spec1 /> <spec3 /> <spec2 /> </specs> <details /> <more_info> <info1 /> <info2 /> </more_info> </thing> </root> okeee so i got this sample xml and the problem is i cant seem to get the values of the innerxml, when i use $reader->readInnerXML() it returns the...

IDE for PHP?

Is there any good IDE for PHP which is lite, accessible and has basic features like file management and code completion? The biggest bad thing about php development is that it's lack of a good IDE. Which IDE are you all using for PHP development? ...

How to deal with duplicate code under Linux?

I'm looking for the best approach to dealing with duplicate code in a legacy PHP project with about 150k lines of code. Is this something best approached manually or are there standalone duplicate code detectors that will ease the pain? ...

reasonable PHP memory_limit for image resize

I want to enable users on my site to upload images to their accounts. The images get resized into 4 different sizes required across the site. I have been using Pear Image_Transform but I kept getting "bytes exhausted" fatal errors on certain types of jpgs (all files tried under 2mb). So I moved to a dedicated server with Pentium Dual-C...

What's the best practice for developing a PHP data import framework?

During our work as web developer for a meteorological company, we are faced with the same task over and over again: Get some files from somewhere (FTP/Web/directory/mail) and import the contained data to a database. Of course the file format is never the same, the databases are always designed differently, countless special cases have t...

PHP to store images in mysql or not?

I have built a small web application in PHP where users must first log in. Once they have logged in, I intend on showing a small thumbnail as part of their "profile". I will have to ensure the image is below a particular size to conserve space, or ensure it is a particular resolution, or both, or even perhaps use something like image ma...

Looking for open source user management and billing PHP web site code

Hello, I need to create a website in which users login, see certain reports, customize, pay (via paypal and credit card) etc. 80% of this is similar to many websites (including stackoverflow) Do you know of a user management code (PHP) that I can use as starting point to save time? Drupal seems to be able to provide what I want but ...

Problem in javascript and PHP

Dear all I using the price in Euro in javascript. var currency = '\u20AC'; Total Sum = Sum in Euro When I try to use in PHP mail. The Euro Symbol is appears differently. I used following command: $mail_body_reply=Sum from Javascript mail($email, $subject_reply, $mail_body_reply, $header_reply); Any idea to act same in PHP and Jav...

PEAR vs PHP time functions

Hi All I'm looking into basic time functions (creating a UTC timestamp and converting into a local timezone). The first set of tutorials i encountered pointed toward PEAR as it's better at avoiding overspill errors in calculations. Now, mid-way through another, it appears that PEAR has issues with some of it's timezone functions running...

What is the best open source PHP charting solution

I need basic charts from PHP code. Google search gives many options. Could you recommend the mainstream, easy and light to work with solution? ...

Is there any way to return HTML in a PHP function? (without building the return value as a string)

I have a PHP function that I'm using to output a standard block of HTML. It currently looks like this: <?php function TestBlockHTML ($replStr) { ?> <html> <body><h1> <?php echo ($replStr) ?> </h1> </html> <?php } ?> I want to return (rather than echo) the HTML inside the function. Is there any way to do this without build...

How can I implement a tag engine in PHP?

I've been trying to implement PHP Tag Engine in my application but only succeeded to do it partially. According to the documentation, to call the HTML form to modify an existing item's tags you should use the following code: $pte->html_item_tags($item_id) The thing is that nothing is explained about how to call the tags form for a new...

How to use SOAP/WSDL in PHP 4?

More specifically I'm trying to make the google adwords API work using PHP 4. What are my options? Any links to a class I could use, sample code, etc would be much appreciated. Thanks. ...

Types of Java web applications

As someone who's fairly new to Java-based web frameworks (currently learning Stripes), I was curious.. what kinds of web applications are you creating with them? I'm thinking it must be something more complicated than yet another blog engine or photo sharing app. (Or perhaps not?) I could see Stripes, Wicket or maybe Struts 2 being used ...

passing multiple values to flash through php

here is the code <php? $id1 =1; $id2 = "module 1 loaded"; echo "$var1=$id1","$var2=$id2"; ?> i know this is not correct way how can i pass these two varables to flash ...

Shell output not being fully retrieved by PHP!

I have a PHP script which executes a shell command: $handle = popen('python last', 'r'); $read = fread($handle, 4096); print_r($read); pclose($handle); I echo the output of the shell output. When I run this in the command I get something like this: [root@localhost tester]# python last [last] ZVZX-W3vo9I: Downloading video webpage [la...