Given a multi-dimensional array that you don't necessarily know the structure of; how would one search for a key by name and change or add to it's contents? The value of the key could be either a string or an array and the effects should be applied either way--I had looked at array_walk_recursive, but it ignores anything that contains an...
I am trying to convert a mysql DATETIME into this format m/d/y but the code below is not working, returns 12/31/1969 instead can someone show me how to do this?
$fromMYSQL = '2007-10-17 21:46:59'; //this is the result from mysql DATETIME field
echo date("m/d/Y", $fromMYSQL);
...
Below is my function that will take a timestamp and tell you the time that has passed from now in the format of 23 days 3 hours 4 minutes 6 seconds
The main problem is on my site I use mysql's DATETIME instead of TIMESTAMP so to use this function I must convert my datetime from mysql to a timestamp and then run it through my function....
I'm working on the comments section for a site, where users can quote something another user said. This is your basic "quote" button on a forum.
Using BBcode for this. But not sure how to accomplish the result.
How is this feature usually done?
i can have
[quote=username] some sentence [/quote]
which would ideally be converted to
...
Hi all,
I have a list of domains and would like to get the:
PageRank for all the domains. So just an integer, there must be an API that returns this.
The number of results in Google
The position of the word of the domainname. For example, "google.com" would be the position of the word "google". This could be position 20.
Hopefully t...
I am using php and mysql. I have a Database config file (db-config.php) which has my database name, username and password. My application and db config file store at: www(httpdocs)/app/db-config.php
Is that secure? Will others/hackers able to steal my file and get my database login information?
Or should i put it outside www folder, fo...
I am working on an authentication system for an online game programmed using PHP and I would like to make sure it is secure. To help with this, I think logging would be useful (and good practice for me as well as a good test for a system logging class). I dont want to use the web server's logs, but I would like to know what would be impo...
I have a code that dinamically resizes an image and sends it to the browser.
But it doesn't work properly... only if I ask it to output the image to a file instead of the browser.
I don't think the problem is my code, because this problem only occurs on the real server; in my computer its working perfectly.
Code:
$img = $_GET['img'];...
I have a flash app, and i want to put an in-app pop up that allows users to submit information that will be handled by a PHP backend. I want this to be secure, both mysql injection wise and anti-bot spam captcha wise. Can someone kindly point me towards a couple of tutorials to get me started?
I need tutorials for:
In-app popup window
F...
hi,
i need to develope a widget (php based) for my client. client wants to display his product prices in it. i have no idea how to make widgets in php? can any one help...
thanks.
...
Hello,
I hit Linux's 32,000 subdirectory limit. It caused problems with my PHP scripts and I don't want it to happen again.
The simple solution is to have my PHP scripts check the current subdirectory count before trying to create another subdirectory.
All ideas I've seen to perform such a check involve iterating over the entire dire...
I have an array in this format:
Array
(
[0] => Array
(
[id] => 117
[name] => Networking
[count] => 16
)
[1] => Array
(
[id] => 188
[name] => FTP
[count] => 23
)
[2] => Array
(
[id] => 189
...
I have two msyql tables, Badges and Events. I use a join to find all the events and return the badge info for that event (title & description) using the following code:
SELECT COUNT(Badges.badge_ID) AS
badge_count,title,Badges.description
FROM Badges JOIN Events ON
Badges.badge_id=Events.badge_id GROUP
BY title ASC
In addit...
Hello,
I have a PHP script that executes a TCL script . The TCL script creates a file , but when I execute through PHP (from browser) , tcl is not able to create a file.
Can anyone guide me .
//PHP code
<?php
$app = 'tclsh84';
$descriptorspec = array(
0 => array("pipe","r"),
1 => array("file","C:/wamp/www/tcl/bin/out.txt","w"),
2 ...
How can i read and pass the variables which are coming in through an xml file as an input to a php file ?
Scenario is my COM object pulls data from an application, i need to pass this information to a php script. How can i do this ? Can i use xml to pass this info to a php file which is called by initiating a web browser.
Any inputs wi...
Except http://us3.php.net/manual/en/book.ktaglib.php and http://getid3.sourceforge.net/ does anyone know of any other way to work from PHP with tags on audio files?
I need to read and write them, and KTagLib seems a little too much for the job, and also don't really get the documentation, and getID3 seems to only write ID3v1 tags.
...
So currently I am using a pattern to grab a data entry (record). It works great for me if I only need to work with one record. However if more than one record is involved it gets more complicated.
Here is my base pattern, using a contacts table:
class Contacts_Entry {
private $_entry = Array('contact_id' => false,
...
Hi, i need a regexp to match only single / in a string in PHP.
"bla bla bla/bla bla bla" //The regexp must match the / character
"bla bla // bla bla / bla bla" //The regexp must match only the last / not the first beacuse it is followed by another /
so i want only unescaped /.
...
I have this code to validate an XML file against an XSD file:
$file = 'test.xml';
$schema = 'test.xsd';
$dom = new DOMDocument;
$dom->load($file);
if ($dom->schemaValidate($schema)) {
print "$file is valid.\n";
} else {
print "$file is invalid.\n";
}
If the xml file is invalid, then it says that it is invalid.
The reason it ...