From the course: PHP for Non-Programmers

Unlock the full course today

Join today to access over 25,200 courses taught by industry experts.

Accepting input

Accepting input

- [Instructor] PHP is primarily made for interacting with people on the web, so it's important to know how to allow people to send information to your programs. This is called accepting input and there are two main ways to do it. The most common way and a method that we'll look at in a later video is through web-based means, forms or ascending data directly through a web address, aka a URL, but the easiest way to get up and running with input using Replit is using their command line interface and a function called readline. As a quick aside, functions are a more complex topic of PHP, but you can think of them as a feature of PHP for now. Readline is a feature that allows you to accept input, just like Printr is a feature that lets you print arrays. In a REPL project, let's type the following. We'll add our opening PHP tag and then we'll create a variable called name, name gets and then we'll use readline and we'll type the…

Contents