I am a Java EE developer working mainly with JSPs, Servlets, and frameworks like Spring.
Will learning PHP be a wise decision ?
What would PHP offer me ?
I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I've found has been written in languages like Java and Haskell that aren't web server friendly in the shared hosting environment that my organization has to live with.
Does anyone know of any PEG libraries or PackRat Parser Generators for Javascript or PHP? Of course code generators in any languages that can produce Javascript or PHP source code would do the trick.
The following PHP code will output 3.
function main() {
if (1) {
$i = 3;
}
echo $i;
}
main();
But the following C code will raise a compile error.
void main() {
if (1) {
int i = 3;
}
printf("%d", i);
}
So variables in PHP are not strictly block-scoped?
I would like to have a quick script listing all active hosts in a LAN, and I am a bit lost. From other posts I figured that this can be done most effectively by polling the DHCP server (in my case a Lancom router) using SNMP.
However, I am not familiar with the SNMP commands in PHP. Is snmpwalk() the correct function? Can I get snmpwalk() or any other php function to return an array that contains a list of all live hosts?
What is faster: writing PHP code using functions or writing it as pure script? So, as I see it Apache or any other server will create from PHP code using functions a pure script... I mean we had:
function foo($a, $b){ return ($a + $b); echo foo(4, 5)}
and Apache will turn it into something like:
echo (5 + 4)
Or will it?
Language Integrated Query. Now I know that the acronyms are. I have seen C# examples, but can't really understand them. Can I use them with PHP? Can I use it along with ORM? Has any PHP MVC framework has this?
I am somewhat new to PHP and I am wondering: How important is it to unset variables in PHP? I know in languages like C we free the allocated memory to prevent leaks, etc. By using unset on variables when I am done with them, will this significantly increase performance of my applications?
Also is there a benchmark anywhere that compares difference between using unset and not using unset?
What are the differences between mod_php and cgi php script?
I mean, why it's better (is it?) to use mod_php instead simple php scripts, running them as CGIs?
Thanks
I'm wondering if this kind of thing will ever be possible in PHP (and whether it already is and I'm just missing something...)
<?php
function test() {
return array(
'id'=>10,
'name'=>'John'
);
}
echo 'Your name is: '.test()['name'];
?>
I'd really like to be able to use returned arrays directly instead of first assigning them to a var... possible?
What is the easiest way to activate PHP and MySQL on Mac OS 10.6 (Snow Leopard)?
I'd prefer to use any built in versions before resorting to downloading from the PHP or MySQL websites.
I'm comfortable at the command line in Terminal.
I'm maintaining a PHP library that is responsible for fetching and storing incoming data (POST, GET, command line arguments, etc). I've just fixed a bug that would not allow it to fetch array variables from POST and GET and I'm wondering whether this is also applicable to the part that deals with the command line.
Can you pass an array as a command line argument to PHP?
What is the use of mysql_rollback() function in PHP?
How is it used?
please explain me with some example,
PS: Please Do not give me link to the php.net or, mysql site, I dont need AUTHOR language to understand it, I need the Developer way to understand...
I hope u understand...
Thanks in advance.
UPDATE
if i have Updated something in a tanle can i Reset the previous value using this function?
It gives me the following message:
The requested URL
/cgi-sys/php-cgiwrap/gcadmin/php5.cgi/projects/globalcolleage/index.php
was not found on this server.
Any suggestions?
(I'm using WAMP)
PHP was the undisputed king of easy webapp development, until Ruby on Rails, Django, and other dynamic programming frameworks appeared. What are, in your opinion, PHP's strengths against the newcomers?
I would like to be able to port some new site pages over to PHP using the same db as in the coldfusion site. Is it possible to have PHP run pages in say other directory and go back and forth ?
Many thanks for your reply.
Terry
How can i write a program in php to get the domain information of an existing domain or a domain name is already taken..?? like informations using php?
There is an epic lack of php CURL love on the internet for beginners like me. I was wondering how to use CURL to download & display an ICS file (They're plain text to me...) in my php code. Unless Fopen is 1,000 times easier, I'd like to stick with CURL for this one.
My Question is suppose I have a form which needs validation through AJAX. The AJAX is sending data to to a file called do_ajax_validation.php Now should I put this file in 'include' folder and name it do_ajax_validation.inc.php and bar it from direct access of the user. Or shud i put it in the directory in which the original form resides??
I am sending an html email with php and it includes an image. Some email programs, such as gMail have a 'display images' button. The user has to click on that in order for the images in the email to show up.
Is there any way I can force email programs to show images that are sent within html emails generated by php?
I have a php page that has a form that asks for an e-mail. When you press the send button, it gets to another php page, which gets the form data and does its stuff. I need to then be able to go back to the old page (the one that contained the form) and give it some data so that it will be able to change itself and say "You've sent your e-mail successfully, and will not display the form.
How do I do it?
Do any exist? Ideally it would also come with a library of basic PHP functions.
I have a bunch of simple PHP scripts (no extensions, no fancy dynamic hacks, etc) I'd like to convert to Java... It would be great if a tool could do 80% of the work while I do the other 20%.
I see i can get a MySQL database defined encoding in PHP using the function mysql_client_encoding(...), but is there a way to get a MySQL table defined encoding in PHP ?
How to show progress bar in PHP where i have to upload the file size of of 100MB? I cannot have APC installed. I am allowed to do so..
Help me out to get it done...
We have PHP5.2+
I've been doing a lot of calculating stuff nowadays.Usually I prefer to do this job in PHP rather than Mysql though I know PHP is not good at this cuz I thought mysql may be worse.But I found some performance problem :some pages were loaded so slowly that 30 seconds' timelimit is not enough for them!So I wonder which is the better practice to do the calculations,and any princles for that?Suggestions would be appreciated.
i am running a mac with mamp and mamp pro. how do i check if i have apc enabled and if its not enabled or not installed how do i install it? thanks
i am trying to get the apc upload loader to work that i found online and it gets stuck on NAN% when im uploading.
this is a link: http://www.haughin.com/2007/10/23/php-upload-progress-with-php-52-apc/