Helpful Information
 
 
Category: Programming Languages
I'm new

Hi there. I'm totally new to PHP3. I'm trying to learn, but I don't see why. What kind of scripts can PHP produce? If it's better than Perl, how can I make the if/else statements like I can in Perl? (eg. if ($platform eq "1") { whatever
} )
you know?
Please, someone help me out here. I'm having a hard time figuring out why I should use PHP over CGI.

- Sam

Let's dispell one myth right now. Saying Perl/PHP is better than the other is like saying a sledge hammer is better than a claw hammer. Two different tools. I'd hate to try to use a claw hammer to drive large posts, but I wouldn't want to use something as difficult to use as a sledge to drive nails.

That said, have you even SKIMMED the manual? If you know any Perl the manual should be all you need. I'm sure most of us couldn't care less whether you use a hammer to drive nails or use your car to drive over them. We're not going to teach you how to use the hammer just to convince you to use it.

If you want help learning, at least apply yourself a bit first, then if you are still lost, come back.

Sorry, if this seems rude, but you must admit that for someone who claims to know Perl, you couldn't have tried very hard if you can't figure out how to do something as simple as an IF..ELSE construct.

I have read over the manual. It's just that I've got contacts that have like, news updaters built in PHP3, and so I figure that it must be able to at least write something to a text file. Maybe I'm wrong. Maybe it's all database driven. They say it's Perl and HTMl, java, and c mixed in, but so far I haven't been able to do much with the perl aspect. I do know perl. I'm writing a rather large script in it right now, but PHP3 seems like it'd be easier, except I can't find how to use it's perl aspects. (ie. if/else =) Call me stupid, I don't care. I guess I'll wait for the language to take off before I start coding entire sites in it.

You may wait for PHP to take off before you code whole sites in them??? That's where I think you may be mistaken. PHP HAS taken off. DevShed.com, 32bit.com, and many other high-end sites that we have created use PHP3 exclusively.

Also here is a link to the section of the PHP manual that discusses if...else statements:

www.devshed.com/Server_Side/PHP/Manual/manfiles/control-structures.html (http://www.devshed.com/Server_Side/PHP/Manual/manfiles/control-structures.html)

And one that discusses file output:

www.devshed.com/Server_Side/PHP/Manual/manfiles/ref.filesystem.html (http://www.devshed.com/Server_Side/PHP/Manual/manfiles/ref.filesystem.html)

Note: fopen(), fread(), fwrite(), and fclose() especially.

Thanks. I know it's taken off, but I don't see too many sites using it as much as other server side scripting languages (eg. ASP), and I haven't seen many books on sale for it. Thanks for the links though.

- Sam










privacy (GDPR)