I am writing a Selenium test in PHP to check the performance of a web application in Firefox. I want to use this as a base-line for comparing different performance enhancements (upgrading JQuery, PHP 5.3, etc.). The web application is very AJAX intense and so far I have only run into one problem.
I have an AJAX call that loads content...
What I need to be able do is format data in a variable, like so:
format: xxx-xxx variable: 123456 output: 123-456
The problem is I need to be able to change the format, so a static solution wouldn't work. I also like to be able to change the variable size, like:
format: xxx-xxx variable: 1234 output: 1-234
All ideas are welcome! Th...
I have an array that looks like:
$fields = array(
"f1" => array("test"),
"f2" => array("other" => "values")
);
I'd like to retrive this information in one array:
$first_dimension = array("f1","f2");
Is there a function in PHP that can extract a particular dimension of an array directly? Is there a syntax shortcut for this?
...
Is there a php function that someone can use to automatically detect if an array is an associative or not, apart from explictly checking the array keys?
...
Hi,
I have a question regarding static function in php.
let's assume that I have a class
class test {
public function sayHi() {
echo 'hi';
}
}
if I do test::sayHi(); it works without a problem.
class test {
public static function sayHi() {
echo 'hi';
}
}
test::sayHi(); works as well.
what are diff...
Is there a PHP equivalent to Webparts? I'm looking for an alternative to the user-pluggable, connectable, customisable application building blocks that are part of SharePoint.
...
When I run a PHP script in Eclipse environment, I can select different browsers to render my page and can get different results.
But the results are still all shown in the browser output window in eclipse itself.
How can I prompt eclipse to actually open a new tab in the browser itself with the php page. I know it can be done by "exter...
I'm trying to display a datetime from my MySQL database as an iso 8601 formated string with PHP but it's coming out wrong.
17 Oct 2008 is coming out as: 1969-12-31T18:33:28-06:00 which is clearly not correct (the year should be 2008 not 1969)
This is the code I'm using:
<?= date("c", $post[3]) ?>
$post[3] is the datetime (CURRENT_TI...
I am having difficulty doing regular expressions when there is whitespace and carriage returns in between the text.
For example in this case below, how can I get the regular expression to get "<div id="contentleft">"?
<div id="content">
<div id="contentleft"> <SCRIPT language=JavaScript>
I tried
id="content">(.*?)<SCRIPT
but...
I have a small application in which i have 9 different forms, and every form have a least 40+ fields where the user must enter some data.
I have written each form in a single php file and made a master PHP file where i only add the form in the middle of the page.
My question is:
I don't want to write 9 different function for each form...
I'm writing some test cases, and I've got a test case that is using Mock objects. I need to check to see if two class methods are called from another class method. Here's what I've done:
First I generated the Mock:
Mock::generate('Parser');
Then, inside my test I called:
$P = new MockParser();
$P->expectOnce('loadUrl', array('http:...
** EDIT **
I'm afraid I wasn't in the right direction - the problem isn't what I asked about.
the Javascript works as it should, it's the PHP that doesn't show what I want it to
on the first "run" - and I'm stil not sure why.
Sorry for somewhat wasting your time...
**
I have a form that might or might not already contain data in its f...
Normally, when I want to allow a user to download a file without revealing the exact location, I just use something like this to let them download the file:
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Conten...
does FastCGI work well with PHP? It seems that some people running Ruby on Rails have problems with FastCGI, but is it fine with PHP?
...
I am using a jquery tabbed interface here http://www.imashdigital.com/#2 and would like to return the tab number in php.
Ideally I would like to run a javascript function (on a timer) that continually updates a global php variable with the current tab.
Based on this php value, 1 through to 4, I will then load a different sidebar.
I wo...
I was looking at the livehttpheaders plugin for Firefox and decided to test my login page. I noticed that the parameters shown inside of it contain my login and password. For example:
username=sarmenhb&password=thepassword&submit=Login
in plain English.
I don not see this on other sites.
What can I be doing wrong? I see this as a se...
Is it possible to output specific JSON data (exported from Firefox bookmarks) using PHP.
This is the code which I have so far, it will re-encode the data as Firefox doesn't export it in the correct UTF-8 way. I also remove the trailing , from the end of the file.
<?php
// Read the file blah blah
$hFile = "../uploads/james.json";
$hFile...
I'm new to Drupal, and frankly after reading through the Drupal documentation, their guide to themeing isn't all that helpful. Maybe I'm just misunderstanding, but it seems like there are certain variables you always have access to and different functions you can define to override or implement behavior.
Long story short, I'd like to b...
if i have a query like this
$query = mysql_query("
SELECT * FROM tbl_school
INNER JOIN tbl_livingexp ON (tbl_school.schoolname=tbl_livingexp.schoolname)
INNER JOIN tbl_tuition ON (tbl_school.schoolname=tbl_tuition.schoolname)
INNER JOIN tbl_apprequirments ON
(tbl_school.schoolname=tbl_apprequirments.schoolname)
where tbl_school.school...
I have a database table which gives me the following result:
array(8) {
["link_id"]=>
string(2) "20"
["link_url"]=>
string(56) "http://url.of/website"
["link_name"]=>
string(34) "Website title"
["link_target"]=>
string(0) ""
["link_description"]=>
string(0) ""
["link_updated"]=>
string(19)...