I am confused about the php there is used to include a file like headers footers functions etc etc so I would like to ask what is the difference between the followings:
okay liek if I write require_once the file will be included once and if i include the file using require statement both will do the same am i right ?
Whether to include or require is a matter for you. I very rarely if ever use 'include' these days as most of the files I include are mandatory to the functioning of my app/page and are 'required'.
Using the _once constructs ensures that the file is only ever included/required once, even if there are multiple instances of including/requiring that file. My sites are not usually convoluted enough to demand the _once, but some seasoned php-heads insist that require_once is the only construct that should be used, ever. I can't say I'm totally convinced by this, as it may increase the time taken for code to run (may be marginal) over a stright require.
If you search long enough, you'll come across some examples of when to use which option. Again, many of these examples are largely subjective and open to argument.