Category Archives: PHP Programming

How to add comments in PHP?

A PHP comment is a line of code that is not run as part of the program. It’s sole function is to be readable by someone who is scanning the code.  Comments may be employed for:   Making your code clear to others. Remind yourself of what you accomplished, Most programmers have encountered the challenge of having to rediscover what they accomplished when returning to their own work after a year or two.  Comments might serve as a reminder of your thoughts when writing the code. Example for adding comments in PHP code. Syntax for single line comment: 2. Syntax for multiple line comment:

What is the difference between a session and cookies?

Difference between cookies and session is : Cookies stores the information on client browser and session stores the information on server. session and cookies are used to store the information.

What is Accessor in Laravel?

As we know laravel accessor is very userful feature. It is used for creating the virtual attribute on the object which you want to access it as database column name. So for example if you want to show full name and in your database table (users) has first_name and last_name columns, you can write: Then you can call $user->full_name and it… Read More »