Jump to content

how to practice php?


Go to solution Solved by QuickOldCar,

Recommended Posts

Hi, 

 

I study a php book and every thing is going fine, the problem is that I dont know how to practice what I study...

 

iv'e searched alot in the internet of exercise and found few but not every thing there is the same as what I study and sometimes they ask me to do things that I dont know yet..

 

some people saying that you need to think about a project and start building it but I dont have enough knowledge so start build something on my own..

 

right now I know about if/else, loops, operators, functions and objects, arrays, date and time, and file handling.

 

so most of the exercise I find involving mysql that I dont know yet.

 

can someone give me tips maybe how he started to study php? 

 

it will help me alot and im sure it will help to more people.

 

 

thakns in advance,

 

guy.

Link to comment
https://forums.phpfreaks.com/topic/291196-how-to-practice-php/
Share on other sites

Hi Guy,

 

You should learn MySQL.  It doesn't take much time to learn the basics.  For a totally new subject, I like the In Easy Steps books.  They have one for MySQL and PHP, but I don't know if they are out of date.  Regardless, you get throught them in a couple of hours, and won't know everything, but will know the basics.  If you want to get more into writing queries, the Simple SQL book is good.

 

If you still want to wait, you could always create an array or object which mimics the output of MySQL.  For insteand, create the following array.  Then use it to practice your loops, etc.

$fakeDBoutput=array(
 array(3,"hello"),
 array(5,"hello"),
 array(7,"hello"),
 array(8,"hello"),
);
Link to comment
https://forums.phpfreaks.com/topic/291196-how-to-practice-php/#findComment-1491705
Share on other sites

Lots of online tutorials are poor examples with bad coding practices and outdated code.

 

There is a lot of useful and current information at the source itself.

http://php.net/manual/en/getting-started.php

 

Will show you anything deprecated not to use, example codes, similar or opposite functions.

 

Think of how hard it would be to read a book without knowing what the words mean.

Once you know most of the functions it gets easier to read others code and understand what they are trying to do.

 

Take a look at function names and familiarize yourself what they all do.

Bookmark the main functions page for the future.

http://php.net/manual/en/funcref.php

 

Some popular and useful areas

http://php.net/manual/en/ref.strings.php

http://php.net/manual/en/ref.array.php

http://php.net/manual/en/book.pdo.php

http://php.net/manual/en/book.mysqli.php

 

Keep reading posts at this site for problems and their solutions.

Many times the poster will explain it pretty clear as to why.

 

People learn in different ways...seeing,doing,reading.

Repetition is the key, keep at it, what you don't understand look it up.

Link to comment
https://forums.phpfreaks.com/topic/291196-how-to-practice-php/#findComment-1491709
Share on other sites

first, thank you very much for the answer.

 

second, its very useful data what you gave me but can you be even more specific, like what you did to study php?

 

and if it helps im study the learning php,mysql,javascript, CSS&HTML5 o'reilly book. this book have alot of info, it has 700 pages.

Link to comment
https://forums.phpfreaks.com/topic/291196-how-to-practice-php/#findComment-1491710
Share on other sites

  • Solution

I myself started coding at age 8 and now 43

So to learn php for me was just learning the syntax and functions.

Once you know some languages is easy to pick up others.

 

I used to host dedicated and virtual private servers, along with websites..

PHP came along and just started to integrate it into existing projects.

 

I was a bit crazy and my first large project in php was making a search engine and a website index.

Along the way have made thousands of functions and scripts that I can use in other projects I do.

 

As to how I studied or learned it, that was a matter of getting familiar with it at php.net, doing my own little scripts and trying to make them work.

When you get an error you try and find what you did wrong and keep going.

 

I noticed you wrote about not having enough knowledge to build your own project.

While that may seem to be true, in reality you can start small and work your way up.

Everyone has ideas, for instance...make something that starts tracking what you have learned in php in a database

Maybe something that is tracking your steps in your quest to learn php.

 

You start out by making a new folder named what you like

drop in an index.php file

open an ide or programmers notepad and start writing code

as you go along create more folders and files

 

You can just keep making small stuff, or keep adding to an existing project...eventually will have something useful.

 

When the time comes you need to do something special, you can look it up and see what is the best choice for the task at hand.

Try them all, see what works or not.

Use from memory or looking it up on google and see what others used.

Link to comment
https://forums.phpfreaks.com/topic/291196-how-to-practice-php/#findComment-1491712
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.