Using PHP... an example. This produces a warning - as expected - and $myVar stays as bool(true).
$myVar = true;
$myVar[] = 'Hello'; // Warning: Cannot use a scalar value as an array
But this next example 'works', $myVar is converted into an array with a single element 'Hello'.
$myVar = false;
$myVar[] = 'Hello'; // Converted into a...
This has been working fine, not sure why it's stopped all of a sudden.. Basically I am getting the error:
Notice: Duplicate dijit ID detected for id "email; temporarily generating uniqid" in ..\Zend\Dojo\Form\Decorator\DijitElement.php on line 171
If I look at the page source, my JS for dojo has been added twice:
var zendDijits = [{"...
If I have an HTML document, what is the best way to go through the document and gather the href values from all anchor tags with a particular class using PHP?
...
Hi folks,
I am running a PHP Script on the CLI (logged in as root). It is actually building a Zend Lucene Search index.
All output is logged to the command line. PHP directves like max_execution_time and memory_limit are set sufficient (0 resp. 1024M). The error reporting is set in the script as follows:
error_reporting(E_ALL | E_STR...
Hi,
I need to clean a string and make sure it contains alpha numeric characters only. I've come up with the following code that for some reason fails
$string = 'aaa`bbb!!';
$string = preg_replace("#[^a-zA-z0-9]*#", "", $string);
echo $string;die;
The output I receive is aaa`bbb while I expect aaabbb. Could you please h...
I've made an application that takes tagged versions of a project from an hg repository and creates a downloadable ZIP file of that the tagged revision.
The files are created on a MediaTemple server running Linux using CodeIgniter's ZIP Encoding Library. Everything works fine... on a Mac. But, when I download the files on a Windows compu...
I've started writing a project using CakePHP (1.3) and am finding it difficult to return results using the CakePHP style of querying.
The project is an issue tracker. So far I only have the following tables - 'users', 'projects' and a link table 'projects_users' because any users can be associated with one or more projects. There is als...
How do I find the sum of all the digits in a number in PHP? I've found solutions for C# and others, but not PHP. How do I do it? Thanks!
...
I am trying to set up a MySQL connection in a main script, and then call various functions depending on what I want to do. I am having trouble passing the connection information to the function.
I have a class "queries" which contains various functions, all which return an array. This is what the code looks like in my main script (calli...
Hello, my question is how do I alleviate the "could not open socket error" that is happening on my site.
I have trouble shot that it is captcha (I'm using recaptcha)
It is only displaying this error on the two pages where I use recpatcha.
I have been generating new sets of keys and sometimes it works and sometimes it does not. For e...
Well, I'm getting a pretty bizarre error from PHPCS:
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="1.2.2">
<file name="/var/lib/hudson/jobs/Goals/workspace/Goals/controllers/UserActivation.class.php">
<error line="1" column="1" severity="error" message="An error occurred during processing; checking has been aborted. The...
According to this Mozilla article on Ogg media, media works more seamlessly in the browser with an X-Content-Duration header, giving the length in seconds of the piece.
Assuming that I have that length stored somewhere (certainly in a database, perhaps also in the filename itself (video-file-name.XXX.ogv, where XXX is the time in second...
Would the following code in a controller prevent the nextFunction() from running?
$this->load->view('foo');
nextFunction();
...
I'm developing a web system using regular PHP. This was my first experience with PHP sothe code is not legible nor clean. It mixes some many html code with PHP.
I'd say I have already done half of the code.
What are the real advantages of the Object-oriented PHP.
The website is about books and book authors, using mysql and apache. So it...
elloo,
i've done some more php 5 certification mock exam questions however i cannot be sure that i'm right with some of the questions so i have decided to post them here. my answers are below each question
if i'm wrong please feel free to criticise. many thanks in advance
Q2. The _____ keyword is used to indicate an incomplete class o...
I really really cant get my head around this, i've thought about this for ages but the penny wont drop. I have just started learning php and sql so for all i know its probably really simple. I want to create a football application with leagues, fixtures, and results for a pc football game that a group of us in college play. The idea is t...
I can't find any info on PHP 6, did they change their minds about the numbering and just fold it all in to PHP 5.3? What is the state of PHP 6?
...
I'm trying to sort a multidimensional array by multiple keys, and I have no idea where to start. I looked at uasort, but wasn't quite sure how to write a function for what I need.
I need to sort by the state, then event_type, then date.
My array looks like this:
Array
(
[0] => Array
(
[ID] => 1
...
I'm trying to extract the users who ask questions on a classified ad website(http://trademe.co.nz/Trade-Me-Motors/Cars/Toyota/Hiace/auction-300294634.htm) . For some reasons the pattern which I'm using is not working always so I would appreciate if you will help me with a perfect regex
Here is my current code
/get memberid of the que...
I have about 50 users in a database and I want to send them a newsletter.
$result = mysql_query("SELECT email FROM users") or die(mysql_error());
$row = mysql_fetch_array( $result ); // had 50 emails
How do I put the $row['email'] into the mail code below.
$m->setBcc(Array("[email protected]", "[email protected]","[email protected]"));...