php

PHP String concatenation - "$a $b" vs $a . " " . $b - performance

Is there a speed difference between, say: $newstring = "$a and $b went out to see $c"; and $newstring = $a . " and " . $b . " went out to see " . $c; and if so, why ? ...

How to Make Zend_Controller_Router resets un-wanted parameter by default

Hi, I'm using Zend-Framework 1.9.5 to make a web-application, But it's Url_Helper was quite tricky to me in the matter of parameter reset!, I know it's a good feature (parameter preserving) but in most cases I don't need it!. So I'm thinking of overriding the default Router to force it loosing parameters Unless I ask for it or maybe spec...

CodeIgnitor, Jquery and Ajax help

I am currently building a website in codeigniter that is one page site, basically one the user comes to the page, they created with a main menu from that menu they choose which sections of the sites they would like to see, and clicks on the associated links...clicking on these links should display the content in their own accordian menu....

Javascript Pseudoclass handling in php

Hi all! I am working with javascript pseudoclasses in the sense of: class Foo ---->getName() ---->setName() ---->.... So i can have collections of them to operate with in client calculations. But, there is some way to handle them "as is" in php? in other words, pass it like an object where I could do a call to getName, for example. ...

How to pass an array plus variables to a function in PHP?

Hi, I have a function prototype as such: function do_upload( $file, $id, $type ) And I'm calling the function like this: $this->do_upload( $files, $id, 'article' ); However, only $files is actually being passed through to the function. I'm sure it's simple but what have I done wrong? EDIT: So $file is just an array of file inf...

Getting/generating an image from embedded flash video

So what I am curious about is if it is possible and how, to have an embedded video and capture the thumbnail. There are other sites that share video and I'd like to get the thumbnails from the embedded videos, but they use flash video players to show the video and likely use flashvars to pull up the right video. I appreciate any help h...

How can I improve the performance of 'include()s' in PHP?

I have a 1.9MB PHP library that I am including at the beginning of my scripts. It contains all of my database objects, methods, etc necessary for my website. It takes 0.1s to 0.3s to include it each time. I use eAccelerator to cache the bytecode of this file. What else can I do to optimize the performance of this 'include'? ...

Declare a Function in PHP Using a String?

Invalid code: $functionName = 'sayThis'; function $functionName($string) { echo $string; } Can I do anything like this? ...

Get the Results of an Include in a String in PHP?

Let's say file test.php looks like this: <?php echo 'Hello world.'; ?> I want to do something like this: $test = include('test.php'); echo $test; // Hello world. Can anyone point me down the right path? Edit: My original goal was to pull PHP code intermingled with HTML out of a database and process it. Here's what I ended up do...

PHP generate a crontab

I want to have a web interface to control when to call a PHP script. In this interface I want to be able to set certain times or ranges that a script will be called. This information will be stored in a DB. When I hit save I want to have it read all the scheduled times from the DB, then format it and write it to a crontab for a cron job....

How to verify Amazon FPS/SimplePay IPN (Instant Payment Notification), using version 2?

I've looked through the documentation, I've tried downloading various example code, and I've tried hacking various permutations. After a full day's worth of work, I'm spent, and throwing in the towel. So now I'm begging for some help. Can someone please post a PHP class or function, wherein I can simply verify that the ping to my IPN sc...

Flash/Actionscript a substitute for css and javascript?

I have reasonable experience with PHP, CSS, and javascript/jquery/ajax. I'm taking my first steps learning Flex/Flash/Actionscript and it's already striking me that using flash/SWF could solve many of my problems. For example: I won't have to worry much about javascript availability e.g. handling the form submit twice like I do now, on...

BOM in a PHP page auto generated by Wordpress

I admin two different blogs. They are both wordpress 2.8.6 (so they have exactly the same source code, plugins apart) but they are located on two different hosting platform (hostmonster.com and aruba.it). To explain my problem I've dumped with SmartSniff a session with each one of the sites. Here is the dump from hostmonster: GET /blog...

PHP/MS Access Question

Hi guys, I need some help figuring out how I should code this. We have this really awful POS program at work (a salon/spa) All the data is stored in a MS Access database. What I am trying to do is create a table like the one here. There will be a seperate table for each of our employees which shows their list of clients and if they h...

What is timeout setting under apache2handler in the php.ini? Does affect session time out?

Hello, I would like to know what the following means under apache2handler in the php.ini Timeouts Connection: 10 - Keep-Alive: 10 I have I problem with session timing out after 10 minutes of inactivity, and I was wondering if the above is what is causing session to time out in 10 minutes instead of 4 hours like I have it below. Cur...

using php xmlreader to get data from xml to mysql

I am using php and xmlreader to retreive data from an xml file and insert into a mysql table. I chose xmlreader because the files supplied me are 500mb. I am new to all of this and am at a sticking point getting the data to insert properly into the mysql table. Sample xml from file... <us:ItemMaster> <us:ItemMasterHeader> <oa:I...

How can I do a sort and search using both GET and POST variables?

I am currently using column header's as links that when clicked will sort the results by the column name by adding a get variable to the url. Here is an example: <a href=" <?php // Sorts by order id. If already sorted by order id, then it will change the link to sort descending if(!isset($_GET['sortby']) || $_GET['sortby'] != 'ord...

JSON_ENCODE in PHP Returns Chinese Characters as Hex

I've got a simple PHP one-dimension array. When I do a var dump (echo var_dump($a)), I get this as the output: array(3) { [0]=> string(3) "尽" [1]=> string(21) "exhausted||to exhaust" [2]=> string(4) "jin3" } However, when I JSON_ENCODE it (echo json_encode($a)) I get this: ["\u5c3d","exhausted||to exhaust","jin3"] The hex value tha...

php convert date to datetime

hi, i need to convert a date in this format: November 28, 2009 to a mysql date format: 2009-28-11 what's the best method to convert the date using php?> thanks. ...

Way to retrieve MySql Fulltext indexs information from PHP?

I asked How to view MySql Fulltext Indexs and got myisam_ftdump as answer. But it's just a command line tool and I need to retrieve those information from PHP. Is there any way to retrieve MySql Fulltext indexs information from PHP? Thanks ...