Hi guys, hopefully you can help me here. I have some code (please see below) which takes the current time, then adds specific seconds to the time and re-displays the time 1 minute in the future.
Instead of the time being the current time, I want it to be a time which I set - say 9:30. Then I want to be able to add, for example 65 second...
I'm using Pear mail_mime to send HTML emails out, and first the UTF-8 characters were messed up in Gmail, but not in Mac Mail. I discovered that I needed to add parameters to the get() function to correct the character set used in the HTML portion of the MIME message. It was defaulting to ISO.
So, I've corrected this problem, the email ...
Hey everyone,
My database contains information extracted from an external feed. In this raw text feed, the following text is used in place of special characters:
& - &
' - &39;
é - é
I extract some of this text to form URLs. For example, a URL that I construct from data containing these characters might look like this:
ht...
To allow caching a PHP generated file, I want to make sure, that the 'Pragma: no-cache' header is not set. However, how do I delete a possibly already set header?
That is, it could be possible, that somewhere in the code someone wrote header('Pragma: no-cache'); and now I want to make sure, the header is not sent.
Is it sufficient to d...
I have the following HTML snippet
<tr>
<td class="1">...</td>
<td class="2">...</td>
<td class="3">...</td>
<td class="4">...</td>
</tr>
etc...
I basically have N rows, and each row contains 4 TD's each with a unique class.
I would like a simple way to split out all the rows and TD's by class so I can choose what data I want to use.
...
I want to calculate the number of Tweets of a Twitter Search, and a countup. Just like GigaTweet. How can I calculate this using PHP and the Twitter API?
...
I'm looking for a "SINGLE INSTALLER" solution for PHP Development.
Is there anything out there which will give me a nice IDE, Web Server, Debugger, Database, etc, on a single install image (*.msi or *.exe)?
This of course would be completely opposite of Eclipse PDT, which requires you to search and locate a bunch of additional componen...
So I just found the most frustrating bug ever in MySQL.
Apparently the TIMESTAMP field, and supporting functions do not support any greater precision than seconds!?
So I am using PHP and Doctrine, and I really need those microseconds (I am using the actAs: [Timestampable] property).
I found a that I can use a BIGINT field to store t...
hi i was going to start leaning php, and i cant setup a server, is there a good emulator, that will show me what im writing without having to run or be part of a server??
...
How would one typically create a dynamic factory method in PHP? By dynamic factory method, I mean a factory method that will autodiscover what objects there are to create, based on some aspect of the given argument. Preferably without registering them first with the factory either. I'm OK with having the possible objects be placed in one...
For edit home status of category I have a link:
<span class=\"ha\" title=\"Active in Homepage\">Active in Homepage</span><a href=\"?page=homestatus&id={$row['id']}\" class=\"hp\" title=\"\">Passive in home page</a>
and function:
function homestatus() {
$ID = mysql_real_escape_string($_GET['id']);
$query = "UPDATE category S...
Hello world,
For one of my projects, I'm using the DOMDocument class to load and manipulate XML documents.
I'd need to retrieve every namespace used in the document; however, I can't find how I'd do that. The DOMDocument class has methods to get the namespace prefix of an URI or the URI of a namespace prefix, but I've seen nothing to a...
I'm trying to output each line in a csv file, and it seems like the delimiter is being ignored... I'm sure my syntax is wrong somewhere, but can't seem to pinpoint it...
The CSV file looks like this:
ID,Code,Count
TM768889,02001,10
TM768889,02002,10
TM768889,02003,10
TM768889,02004,10
TM768889,02005,10
I'm trying to output:
0 ...
Is it considered better practice and/or more efficient to create a 'reset' function for a particular object that clears/defaults all the necessary member variables to allow for further operations, or to simply construct a new object from outside?
I've seen both methods employed a lot, but I can't decide which one is better. Of course, f...
I've got my database set up with three tables - code, tags, and code_tags for tagging posts.
This will be the SQL query processed when a post is submitted. Each tag is sliced up by PHP and individually inserted using these queries.
INSERT IGNORE INTO tags (tag) VALUES ('$tags[1]');
SELECT tags.id FROM tags WHERE tag = '$tags[1]' ORDER ...
Well, recently i bought a software that submits RSS to various RSS directories. Some of the directories, when we visit manually through a internet browser, requires registrations to submit our feed (Most popular example of such directories is feedage dot com)
What made me wonder is, the software don't ask any login details while submitti...
I am trying to set a custom class to an Iterator through the setInfoClass method:
Use this method to set a custom class which will be used when getFileInfo and getPathInfo are called. The class name passed to this method must be derived from SplFileInfo.
My class is like this (simplified example):
class MyFileInfo extends SplFile...
I am currently using various back-end services and I want to use PHP to simply query these services and perform the final page construction. These services could be coded in any number of programming langauges such as Erlang, Java, Python etc. However I am unsure of the best way to actually interface the back-end services with the web ap...
Hi all I have this line in my php code
`$insert = "DELETE FROM allocation_table WHERE job = '$jobnumber' " ;
Mysql_query ($insert) ;`
The problem is it will remove all the values from the the one line in my table but not the entry itself. as you can see in the picture if I delete where job = 315 , it does not delete the line but do...
Is there any reason why the fread() function wouldn't work (no errors show up) when reading from a .php file over a .txt file?
code
$file = fopen("db.php","rw");
$data = fgets($file, filesize("db.php"));
echo($data);
fclose($file);
die();
...