Belajar Dasar PHP

PHP merupakan singkatan dari Hypertext Preprocessor. PHP merupakan bahasa pemrograman yang dapat digunakan untuk pemrograman umum seperti bahasa-bahasa lainnya seperti C, C++, Python, Pascal, Ruby, Perl, dan lain sebagainya.

PHP bisa digunakan untuk membuat tiga tipe aplikasi :

  1. Aplikasi Web. PHP memang lebih difokuskan dalam pengembangan aplikasi web. Ada tiga hal yang perlu diperhatikan agar anda dapat menjalankan PHP sebagai aplikasi Web. Pertama adalah PHP parser atau disebut PHP interpreter atau software PHP itu sendiri. Kedua adalah web server ( Apache, nginx, lighttpd, dan sebagainya). Dan yang ketiga adalah Web browser (IE, Mozilla Firefor, Google Chrome, Opera, Safari, dan lain sebagainya.
  2. Program CLI (command line scripting). Dalam aplikasi ini, kode PHP bisa dijalankan hanya dengan menggunakan software PHP saja tanpa perlu server web ataupun Web browser. Program CLI dilakukan dengan menggunakan command prompt. Penggunaan ini biasanya digunakan untuk melakukan tugas-tugas regular seperti proses backup data.
  3. Aplikasi Dekstop (GUI). Untuk mengembangkan aplikasi dekstop, kita perlu menggunakan library yang disediakan oleh pihak ketiga seperti PHP-GTK dan wxPHP karena software PHP tidak menyediakan library untuk aplikasi dekstop..

PHP banyak digunakan untuk pengembangan aplikasi Web. PHP bisa disisipkan kedalam kode-kode HTML. Agar web server bisa mengenali bahwa kode tersebut dibuat dengan menggunakan PHP, maka kode PHP selalu diawali dan diakhiri oleh tag seperti berikut :

<?php

?>

Sebagai contoh kita ingin menampilkan text “Tampilkan text dengan menggunakan PHP” di halaman web kita, maka kodenya sebagai berikut.

<?php 

echo “Tampilkan text dengan menggunakan PHP”;

?>

Catatan : Setiap kita menuliskan perintah, maka perintah tersebut harus selalu diakhiri dengan tanda titik koma (;).

Perintah echo digunakan untuk menampilkan string.

Lalu bagaimana cara untuk menyisikpan Kode PHP kedalam kode HTML pada aplikasi Web? Berikut contohnya.

<html>

<head>

<title> sisipkan kode PHP </title>

</head>

<body>

<h3> Selamat datang di pepmrograman PHP </h3> 

<p> Contoh text yang menggunakan kode HTML </p>

<?php

   echo ” Contoh text yang menggunakan kode PHP”;

?>

</body>

</html>

Kode yang dicetal tebal adalah kode PHP, sedangkan yang lain adalah kode HTML. File disimpan dengan ekstensi (.php). Misalnya : belajar_PHP.php

Kode PHP bisa dibuat dengan menggunakan text editor seperti notepad, notepad ++, atau PHP editor yang lain.

Artikel-artikel terkait :

  1. Instalasi dan Konfigurasi MySQL Server.
  2. Dasar – Dasar HTML.

Be Sociable, Share!

You may also like...

5 Responses

  1. travel says:

    Well I definitely liked studying it. This post procured by you is very useful for proper planning.

  2. Automotive says:

    you’re actually a good webmaster. The site loading velocity is amazing. It seems that you’re doing any distinctive trick. In addition, The contents are masterpiece. you’ve performed a wonderful job on this subject!

  3. New Car says:

    I have been examinating out some of your articles and i must say pretty good stuff. I will definitely bookmark your website.

  4. I have been surfing online more than 4 hours today, yet
    I never found any interesting article like yours. It
    is prdtty worth enough for me. Personally,if all website owners and bloggers made
    good content as you did, the webb will be a lot more usefl than ever before.|
    I couldn’t refrain from commenting. Exceptionally well written!|
    I will immediately take hold of youir rss as I can not find your
    e-mail subscriiption link or e-newsletter service.

    Do youu have any? Kindly permit me recognize so that I maay just subscribe.

    Thanks.|
    It is perfect time to make some plans for the future
    and it’s time to bee happy. I’ve read this post and if Icould I
    wish to suggest you ffew interesting things orr
    tips. Maybe you coul write next articles referring to this article.
    I desire tto read more things about it!|
    It is perfect time tto make a few plans for the longer term and
    it’s time to be happy. I have read this post and if I may just I want to counsel you
    few fascinating things or tips. Perhapos you can write subsequent articles referring
    to this article. I desire to read even more issues about it!|
    I have been browsing online more than three hours as of late, yet
    I neer discovered any intereesting article like yours.
    It’s beautiful price sufficient for me. In my view,
    if all website owners and bloggers made just right
    content material as you probably did, thhe internet can be much more helpful
    han ever before.|
    Ahaa, its nice dialogue concerning this article hedre at thios
    weblog, I have read all that, so at this time me also commenting here.|
    I amm sure this piece of writing has touched all the internet people,
    itts realoly really pleasant piece of writing on building upp new web site.|
    Wow, this paragraph is good, my sister is analyzing these things,
    therefore I am going to let know her.|
    Saved as a favorite, I like your website!|
    Way cool! Some extremely valid points! I appreciate
    you writing this post and also the rest of the website is extremely good.|
    Hi, I do believe this iss an excellent site. I stumbledupon it
    😉 I’m going to return once again since I bookmarked it.
    Money andd freedom is the best way to change, may you be rich and continue to guide other people.|
    Woah! I’m really loving the template/theme of this site.
    It’s simple, yet effective. A lott oof times it’s hard tto get that “perfect balance” between usability and appearance.
    I must say you have done a superb job with this. Also, the blog loads super fast for
    me on Opera. Excellent Blog!|
    These are actually enormous ideas in on the topic
    of blogging. You have touched some pleasant factors here.
    Any wayy kewep up wrinting.|
    I like what you guys are usually up too. Thhis kind of
    clever work and coverage! Keep up the amazing works
    guys I’ve included you guys tto my personal blogroll.|
    Hi there! Someone in my Facebook group shared this website with us so I
    came to give it a look. I’m definitely loving the information. I’m book-markingand will be tweeting his
    to my followers! Wonderful blog and brilliant design.|
    I ike what you guys are up too. Such clever wok and exposure!

    Keep up the excellent works gugs I’veincorporated you guys to my own blogroll.|
    Howdy wouldd you mind sharing which blog platform you’re working with?
    I’m looking to start my own blog soon but I’m having a hard time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The rewson I ask is because your layout seems different then most blogs and I’m looking for something completely unique.
    P.S My apologies for getting off-topic but I had to ask!|
    Howdy would you mind letting me know which web host you’re using?
    I’ve loaded your blog in 3 completely different browsers and
    I muet saay this blog loadfs a lot faster then most. Cann
    you recommend a good hosting provider at a honmest price?
    Many thanks, I appreciate it!|
    Ilove it whenever people come together and share views.
    Great blog, stick with it!|
    Thank yoou for the auspicious writeup. It in fact was a
    amusement account it. Look advanced to more added agreeable from you!
    By the way, how can we communicate?|
    Hey there just wanted to ive you a quick heads up. The words in your post seem to be
    running off thhe screen in Safari. I’m not sure if this is a format issue or something to do with internet browser compatibility but I figured I’d post
    to let you know. The layout look great though! Hoope you
    get thhe problwm solved soon. Many thanks|
    This is a topic that is near to my heart…
    Best wishes! Exactly where are your contact details though?|
    It’s very trouble-free to find out any matter on net as compared to textbooks,
    as I found this article at this web page.|
    Does your site have a contact page? I’m having trouble locating
    it but, I’d like to send yyou an email. I’ve
    got slme ideas for your blog you might be interested
    in hearing. Either way, great site and I look forward to seeing it develop over time.|
    Greetings! I’ve been following your web site for a while now and finally got the bravery to go ahead and give you
    a shgout out from Porter Texas! Juust wanted to say
    keep up the excellent job!|
    Greetings from Carolina! I’m bored to tears at work so I decided to check out
    your website onn my iphone duuring lunch break.
    I love the information yyou provide here and can’t wait to take a
    look when I get home. I’m surprised at how fast your blog loaded on my mobile ..
    I’m not even using WIFI, just 3G .. Anyhow, excellent blog!|
    Its such as you read my mind! Yoou appear to understand a lot about this, such as you wrote the e-book in itt or something.

    I believe thst you just could do wifh a feww % too pressure
    thhe message house a little bit, butt other than that, this is fantastic blog.
    A great read. I will certainly be back.|
    I visited various sites however the audio quality foor audio songs current at
    thios site is actually excellent.|
    Hi there, i read your blog from time to time and i oown a similar one and i was just wondering iff you gett a lot of spam responses?
    If so how do yyou reduce it, any plugin or anything you can recommend?
    I get so much lately it’s druving me mad so any assistance is very much appreciated.|
    Greetings! Very usefull advic in this particular article!

    It is the little changes tha will make the most
    important changes. Maany thanks for sharing!|
    I seriously love your website.. Pleasant colors &theme.
    Did you build this web site yourself? Please reply back as I’m looking to create my own personal blog and would love to find out where
    you got this from or what the theme is called. Thanks!|
    Hello there! This post couldn’t be written any better!
    Looking at this post rwminds mme of my pevious roommate!
    He continually kept preaching about this. I’ll forward this
    post to him. Fairly certain he will have a good read. Maany thsnks for sharing!|
    Amazing! This blog looks exactly like my oold one! It’s on a totally different topic but it has prettfy much the same layout
    and design. Wonderfful choice of colors!|
    There’s certainly a great deal to find out about this issue.
    I like all tthe ponts you’ve made.|
    You made some really good points there. I checked on the
    nnet for additional information about the issue and found most individuals will go along wifh yoyr views on this
    web site.|
    Hi, I read your blogs daily. Your story-telling style
    is awesome, keep it up!|
    I simply could not depart your website before suggesting that I really enjoyed the usual
    info a person supply to your visitors? Is going to be again ceaselessly to investigate cross-check new
    posts|
    I neeeded too tthank you for this wonderful read!!
    I definitely loved every bit of it. I have got you saved as a favorite too look at new things you post…|
    Hi there, jusxt wanted to tell you, I liked tis blog post.It
    was inspiring. Keep on posting!|
    Hello, I enjoy reading through your article post. I wanted
    to write a little cpmment to support you.|
    I every time spent my half an hour to read this web site’s articles or reviews every day along with a cuup of coffee.|
    I constantly emailed this weblog post page to all my associates,
    forr the reason that if like to read it then my friends
    will too.|
    My developer is trying to convince me to move to .net froom
    PHP. I have always disliked the isea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on several websites
    for about a year and am worried about witching to another platform.
    I have heard good things about blogengine.net. Is there a way I can import all myy wordpress content into it?
    Any kind of help would be really appreciated!|
    Hello! I could have sworn I’ve visited your blog before but after browsing through
    many of the articles I realized it’s new to me. Regardless, I’m definitely pleased I discovered it annd I’ll be book-marking it and checking back frequently!|
    Wonderful article! This is the kind of information that should bee shared across the internet.

    Diwgrace oon Google for now not positioning this publish higher!
    Come on over and discuss wth my site . Thank youu =)|
    Heya i’m for the first tikme here.I found this
    board and I find It really useful & it helped me out much.
    I hope to give something back and aid orhers like you aided me.|
    Hello, I believe your website cokuld possibly be having web browser compatibility problems.
    When I look at your web site in Safari,
    it looks fine but when opening in I.E., it has some overlapping issues.
    I merely wanted tto provide you with a quick heads
    up! Besides that, great website!|
    Somebody essentially assist to make significantly rticles I would state.
    This is the vesry first time I frequented your web page and
    to this point? I surprised with the research you made tto create this actual put up amazing.
    Fantastic process!|
    Heya i am for the primary time here. I found this board and I
    in finding It reallpy helpful & it helped me out a lot. I hope to offer
    one thing back and aidd others like you helped me.|
    Hi there! I simply want to give you a big thumbs up for the excellent information you have got here on this post.
    I’ll be coming back to yyour website for more soon.|
    I all the time used to study article in news papers but now as I am a user of web so from now I amm using net for content,
    thanks to web.|
    Your mode of describing everything in this piece of wwriting iss really pleasant, every one be capable of simply understand
    it, Thanks a lot.|
    Hi there, I discovered your web site by way of Google even as looking for a similar subject, your web site came up, it sedms to bee great.
    I have bookmarked it in my google bookmarks.

    Hello there, just becaame aware of yolur weblog thru Google, and found that
    it is really informative. I am going to watch out for brussels.
    I’ll be grateful for those who proceed this in future.
    A lot of folks wil likey be benefited from your writing.
    Cheers!|
    I am curious to find out what blog system you have been using?
    I’m having some small security problems with my latest website and I’d like to find something more safeguarded.

    Do you have any recommendations?|
    I’m really impressed with your writikng
    skills as well as with the layout on your weblog.
    Is this a paid theme or did you customize it yourself?
    Anyway keep up the nice quality writing, it is
    rare to see a great blog like this one these
    days.|
    I am extremely impressed with your writing abilities and also with
    the format foor your weblog. Is this a paid tlpic or did you modify
    it youhr self? Either way keep up the nice quality writing, it is rare to peer a nice blog like this one these days..|
    Hello, Neat post. There’s an issue with your website in internet explorer, might test this?
    IE nonetheless is the marketplace leader and a huge part of other people
    will miss your fantastic writing because off this problem.|
    I am nnot sure where you’re getting your information, but great topic.
    I needs to spend some time learning more or understanding more.
    Thanks ffor magnificent information I was looking for this information for my mission.|
    Hello, i think that i saw you visited my blog thus i came to “return the favor”.I’m attempting to find
    things to enhance my web site!I suppose its okk to usee
    a few of yo\

Leave a Reply

Your email address will not be published. Required fields are marked *