Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: PHP primer for Perl hacker?

by amt (Monk)
on Dec 15, 2004 at 20:41 UTC ( #415188=note: print w/replies, xml ) Need Help??


in reply to PHP primer for Perl hacker?

Picking up PHP from perl is a cakewalk, I had to do it for my job, but here are a few pointers.

print is now echo, single vs. double quotes still applies, ALL variables are $foo, remember your <?php ?> tags for web pages, require is now include('file.php') if you want to organize your code, and checking /var/log/httpd/error_log is still very good ;)

as for mysql: http://us3.php.net/manual/en/ref.mysql.php and http://php.net is your friend.
amt.

perlcheat

Replies are listed 'Best First'.
Re^2: PHP primer for Perl hacker?
by revdiablo (Prior) on Dec 15, 2004 at 21:20 UTC

    If you search at http://php.net, you will see that PHP has both print and require functions. It's worth pointing out that PHP's require is different from Perl's in a number of ways (PHP's require is more similar to Perl's EXPR form of do), but PHP's include is even more different. The closest thing PHP has to Perl's require is probably require_once.

      A big difference between Perl and PHP is that a syntax error is not a fatal error (it just interrupts loading the current file), while a doubly defined function, is. And yes, in case you're wondering: in perl, it's exactly the opposite.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://415188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2019-12-11 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?