I need to write the local time information , the exception message to a php log file. I don't know why I can't get the format correct. The script I use is this:
error_log('['.date("F j, Y, g:i a").']'.$msg." <br>", 3, $phperrorPath);
There are two problem with this:
The date is not written in local time, instead it's default to t...
For some reason I have always assumed that most of the time a variable returned from a method would be returned by reference - after all on return; most methods would destroy the return value and it seems silly to make a copy, return it, then destroy the originals.
Does the above ever apply, or is it worth going through and making funct...
I've started to use mysql_data_seek () as an easy way to roll pagination transparently into my database class by shifting the pointer and reading the current 'page'.
What are the performance implications of doing this? I am only reading the data I need into PHP itself, but in most cases the SELECT covers the whole table - is this bad...
I'm having real problems getting PDO_MYSQL working.
I started by just trying to install the PDO_MYSQL driver via PECL, however when this didnt work I looked round to see if there where any issues reported. It seems that there may be a conflict between the embedded version of PDO and PDO_MYSQL. To that end i decided to reinstall all it'...
Hey folks! I need some help with regular expressions/etc. I need to extract virtual keys from url, some sort of router in application. Here are the params:
Rule: /books/:category/:id/:keyname
Data: /books/php/12345/this-is-a-test-keyname
Output should be something like that:
array(
'category' => 'php',
'id' => '12345',
'keyname...
I've had an unusual client request in regard to fraud detection in an online raffle which I'm trying to build as efficently as possible by pushing as much of the task into SQL as possible.
The structure is thus:
table: codes
raffle_code | ticket_type | sequence
A00000001 Red 1
A00000002 Red 2
...
A0000...
Hi,
I'm trying to refresh a page without sending POST from the previous time.
I've tried
window.open("postme.php?r=t","_self");
Which appends a ?r=t to the end but it doesn't appear to refresh the page as the page displays a number of file s in a directory which hasn't change even though I have moved or deleted them.
Can you specify...
I have a filelist.txt file
and i create clear.php file to clear the content of filelist
in index.html i put a button to call clear.php to clear
Can anyone help me out regarding:
What php code should i write in clear.php
How to code a button to call clear.php and then return back to index.html showing the result that it has been clea...
Hello,
Can anyone recommend a good tool for searching though the body of files (office, powerpoint ect). It needs to be integrated as part of a PHP site. Alternatively, any server side applications that could be used for creating indexes of the search terms.
thanks
...
Hi, new here so thanks for taking the time to read my question.
I am running some PHP code that compares the numbers enter on the screen with those in a database. The problem I am having is ordering the two dimensional array after manipulating each line. It looks as though the array id numbers are being removed. I would like to order th...
I cant quite get my head around what the ^ is doing in my preg_match.
if (preg_match('~^(\d\d\d\d)(-(\d{1,2})(-(\d{1,2}))?)?$~', trim($date), $dateParts)) {
echo the $dateparts and do some magic with them
} else {
tell me the date is formatted wrong
}
As I see it this is looking to see if the $date matches the format which I ...
Hiya All,
I am trying to come up with a "smart" and "secure" way of generating about 63million unique codes to be used in a competition. The codes will be about 10 characters long.
Has anyone done anything similar or aware of any "hurdles" that might arise from this issues? How do we minimize the probability of someone being able to gu...
One of the fields in my database is of 'DATE' Type (field-name = 'post_date').
after fetching an array $record = mysql_fetch_array($queryResult);
if I do echo $record['post_date'];
I do not get any output (blank).
What should I do to properly handle the date type?
...
Hi all
I need to add values received from MySQL into an array [PHP], here is what I've got:
$players = array();
while ($homePlayerRow = mysql_fetch_array($homePlayerResult)) {
$players[] = $homePlayerRow['player_id'];
}
Is this the only way of doing it? Also, is the following faster/better?
$players = array();
while ($homePlay...
I'm trying to get Zend Amf working on my hosting services (Lunarpages, if that matters). I can get it working on my local machine, but after changing a few directories and posting the code, I keep getting this error:
Parse error: syntax error, unexpected T_STRING, expecting '{' in /home/user_name/public_html/library/Zend/Amf/Server.php...
I have $fromdate and $todate variables. I want a function that can calculate the dates of each Sunday existing in between $fromdate and $todate in PHP.
...
Hi all,
I want to recursively search and replace elements in an array.
The array is tree based so looks like
Object
Children
Object type A
Object type B
Object
Children
Object type A
Object
etc.
I want to be able to replace certain items with other items, so for example, I want to replace all entries in the ...
Hi everyone,
I'm beginning with Zend Framework and I would like to understand Bootstrap file. I've learned all _init methods are executed by default but it seems confusing to me. Anyway that is not what I would like to ask.
A came around the $this->bootstrap('layout'); action and I'm not sure if I understand this. Is this the resource....
I created an anagram creating application, by creating an anagram field in my database, with a lower cased alphabetically stored string.
For example, suction becomes cinostu, ear becomes aer, and so on.
What I want to do now is create sub words from the original anagram searched for.
Example: How would you go about pulling the subset ...
I have a Date object ( from Pear) and want to subtract another Date object to get the time difference in seconds.
I have tried a few things but the first just gave me the difference in days, and the second would allow me to convert one fixed time to unix timestamp but not the Date object.
$now = new Date();
$tzone = ne...