Php

How To Install Ubuntu LAMP (Apache, MySQL, PHP)

How To Install Ubuntu LAMP (Apache, MySQL, PHP)

Fadıl

What is localhost, what does it do?

Localhost is the computer’s ability to operate as a server thanks to the software installed on the computer. We cannot run PHP files on a normal computer and do not perform operations on the database. Thanks to the installation of the localhost, our computer will gain a server feature and we will be able to run files such as PHP, MySQL.

We can access the localhost by typing http://localhost in our browser or at http://127.0.0.1.

What is Composer, How to Install and Use?

What is Composer, How to Install and Use?

Fadıl

If you have been developing software with PHP for a while, you may have noticed that wasting time to re-download, write, and try to use the current version is a huge loss. If you are projecting using libraries such as Zend, Symfony, and Laravel, you need more.

What?

Dependency management tool for PHP. It allows you to define the libraries your project needs and install and update them for you. The important thing here is that the update does not automatically do so according to its own head.

PHP Function:  Built-in Functions part 12

PHP Function: Built-in Functions part 12

Fadıl

The last of the Built-in Functions!
String Functions
The functions I will add here only scratch the surface of PHP’s built-in string manipulation functions, but if you understand thses common functions, your programming life will be a lil easier.

addslashes() and stripslashes()
The addslashes() and stripslashes() functions are very important when inserting and retieving data from a database. Often, text inserted into a database will contain special characters such as, single quotes, double quotes, backslashes, NULL, etc. that must be escaped before being inserted. The addslashes() function does just that using this syntax:

PHP Function:  Built-in Functions part 11

PHP Function: Built-in Functions part 11

Fadıl

Session-Handling Functions
Session handling is a way of holding on to data as a user navigates your Web Site. Data can be variables or entire objects.

session_start()
The session_start() function starts a session if one has not already been started, or it resumes a session if the session ID is present for the user. This function takes no arguments and is called simply by placing the following at the beginning of your code:

PHP Function:  Built-in Functions part 10

PHP Function: Built-in Functions part 10

Fadıl

Regular Expression Functions

ereg_replace() and eregi_replace()
The ereg_replace() and eregi_replace() functions replace instances of a pattern within a string and return the new string. The ereg_replace() function performs a clase-sensitive match, and eregi_replace() performs a case-insensitive match. Here is the syntax for both functions:

ereg_replace(pattern, replacement, string);
eregi_replace(pattern, replacement, string);

For example, you would use the following code to replace “ASP” with “PHP” in the string “I really love programming in ASP”: