Is there anyway to find the date difference in php? I have the input of from date 2003-10-17 and todate 2004-03-24. I need the results how many days is there within these two days. Say if 224 days, i need the output in days only.
I find the solution through mysql but i need in php. Anyone help me, Thanks in advance.
Hi All mates!
This time ask you this question:
Assuming we have this img ( generated by php ) linked in clients sites
<img src="http://mysite.com/genimg.php?id=2" alt=""/>
Is Possible to get back from the client location some infos!? ( es. client url )
PS:
don't need something that open
the entire client page and search for link!
don't need something that work just if the link image is
clicked!
Looking around, there are plenty of options available for form management in PHP from several frameworks: Zend, CakePHP, CodeIgniter, Symphony, and probably several others offer solutions. All else being equal, which set of form classes do you prefer? What makes any of these better than the others?
This is confusing as hell, here's the php I'm using:
<?php echo date('H:i D j, F',$j->date); ?>
This is what it gives me:
01:33 Thu 1, January
Which seems fine, until you look at the actual time that is being given ($j-date provides):
2010-06-12 21:12:23
Why is it giving me a January and what am I doing wrong?
Hi,
We were given an assignment to develop a prototype for a customer community. It was suggested PHP as the programming language. (but we're not supposed to actually code it, just a prototype with documentation is required)
I'm wondering what are the best practices/ tools used in Unit testing, Integration Testing and System testing for such a php app
Thanks
Hi i would like to filter array in php. for example
$a = ARRAY('a', 'b', 'c', 'd', 'e');
$b = ARRAY('c', 'd');
$a will be filtered by values in array $b
and result is ['a', 'b', 'e']
may I know how to do it in php?
Thank you.
I am a php beginner and seed on the forum such a php expression:
$regex = <<<'END'
/
( [\x00-\x7F] # single-byte sequences 0xxxxxxx
| [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
| [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
| [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3
)
| ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111
| ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111
/x
END;
is this code correct? what should mean some strange (4 me) constructions like <<< 'END' / /x and END;
thanks
I want to have users store the url in my database I'm using php mysql and htmlpurifier I was wondering if the following code was good way to filter out bad data?
Here is the Partial PHP code.
$url = mysqli_real_escape_string($mysqli, $purifier->purify(htmlspecialchars(strip_tags($_POST['url'])));
Warning: sprintf() [function.sprintf]: Too few arguments in /home/inrunitc/public_html/chek/chek.php on line 132
Query was empty
I am new to PHP and mysql and I have like 88 fields in my form - what should I do ?
Hi
I want to write a php script which updates svn working directory
I tried with below code , but it does not work.I guess because the USER for php script is "apache" but for svn update it needs to be "homeuser"
putenv("USERNAME=homeuser");
putenv("HOME=/home/homeuser");
exec("svn update /home/homeuser/path/to/working/dir", $info); //svn update with full path
print_r($info);
how to get around ?
I tried to follow PHP.net curl site and even this link: http://curl.phptrack.com/forum/viewtopic.php?t=52
and try to install the CURL in my window laptop. It doesn't work.. CURL is not installed.
I wonder do I need to run it on windows server...
Anyone has good sites guiding me how to install CURL? thanks.
Hello,
Is it possible to "deny from all" apache htaccess style using php.
I can't use htaccess because im using different webserver, so i wan't to use php to workaround it.
So let say user are trying to access folder name 'david', all content and subdirectory are denied from viewing.
Hi,
i need to get a reference to the FORM parent of an INPUT when I only have a reference to that INPUT. Is this possible with javascript (or else jQuery) ?
function doSomething(element) {
//element is input object
//how to get reference to form?
}
This doesn't work:
var form = $(element).parents('form:first');
alert($(form).attr("name"));
PHP beginner's question.
I need to keep image paths as following in the database for the admin backend.
../../../../assets/images/subfolder/myimage.jpg
However I need image paths as follows for the front-end.
assets/images/subfolder/myimage.jpg
What is the best way to change this by PHP?
I thought about substr(), but I am wondering if there is better ways.
Thanks in advance.
I have a local server which needs to make changes to a virtual hosts apache config file and then restart apache so the new config takes effect.
Can PHP do this? I tried passthru and exec but they didn't work. Maybe the problem is that I'm trying to restart PHP's parent process?
Thanks for any help!!
Getting the following error when trying to start a session:
Warning: session_start() [function.session-start]: Node no longer exists in file.php on line 3
The script uses SimpleXML to parse XML files from remote hosts. It's running on a Linux Ubuntu server with PHP 5.2.6.
Has anyone come across this message before or have an insight in to what it means?
Hello, did you know a php script (a class will be nice) who get the url of the first image result of a google api image search? Thanks
Example.
<?php echo(geturl("searchterm")) ?>
hi all
i am working on a project, it need email validation when user enter his email address check for availiblity. i wrote the php code in javascript it works fine but my problem is when some see my page source it display all user email address in javascript code. i want hide this one.
i wrote javascript code in seperate file but validation is not working.
if any one hide how hide javascript code in php, guide me plzz.
thanks
What is the best way to implement web services in PHP? I have heard about libraries like NuSOAP and WSO2 web service platform, But don't know what is the best ( or a good and easy to learn) for using web service in PHP?
I'm interested in literature (articles on internet, in magazines, books, podcasts - I don't really mind anything) that describes how PHP works internally, about its gotchas and perhaps some advanced functions. Is there anything like this out there? I tried to search on Google, but majority of articles were about starting with PHP and its basic functions.
Any input is really welcome as I'm trying to understand the language internally - I'm tired of my mindless typing of code without understanding its essence.
Hello, I've recently started learning PHP, but I have a wide knowledge on C++. I've been wondering how to make a web bot and now, I would greatly like to make one. I won't be using this robot for spamming or anything, just as a test of what PHP/C++ can do online. I was wondering how I could go about doing this and if you have any articles/tutorials that would be helpful.
Thanks,
John
Hi guys,
I am trying to write an php twitter script which will be run by crontab, what the script does is to get the tweets from a dedicated twitter account.
I have looked at some of the php twitter oauth libraries, all of them seem to use redirect to a twitter page to get a token, then goes back to a callback link. In my case I don't want to have any user interaction at all.
Could anyone please tell me what I should do?
Regards
James
Hi everyone...
All are aware of the rename function in php ....
But is there a way to just change the name of a folder using php...? Or copying the whole folder to a new place with the intended name is the only way..?
Thanks for your answers...