Found 1060 Articles for PHP

Should I Learn Python or PHP for the Back End?

Tushar Sharma
Updated on 04-Apr-2023 11:46:25

385 Views

A stable online presence is indispensable for both persons and agencies in the modern-day digital era. Web builders are in high demand in order to do this. To guarantee that the entirety features properly, it is crucial to select the fantastic programming language for the returned end. So, one of the most well-liked programming languages is PHP, which has been around for a while and developed a reputation for its unique characteristics. Another popular language is Python and selecting between them can be a challenge. Here, we will explore the differences between Python and PHP and get you ready to ... Read More

PDF generation from XHTML in a LAMP environment

Satish Kumar
Updated on 14-Mar-2023 16:18:27

337 Views

The LAMP environment is widely used for web development, and it is an acronym for Linux, Apache, MySQL, and PHP. This environment is an open-source platform that is easy to use and deploy. PDF format is commonly used for sharing and exchanging documents over internet. However, generating PDF documents can be a challenging task in a LAMP environment, especially when converting XHTML documents. In this article, we will explore different methods used for PDF generation from XHTML in a LAMP environment. What is XHTML? XHTML stands for Extensible Hypertext Markup Language, which is a markup language that is used to ... Read More

PHP and Xvfb usage

Satish Kumar
Updated on 14-Mar-2023 16:14:56

1K+ Views

Introduction Xvfb stands for "X Virtual Frame Buffer" which is used to create a virtual display in memory without any attached physical display device. It allows running graphical applications without any actual graphics hardware. PHP is a server-side scripting language widely used for web development. In this article, we will discuss how we can use Xvfb with PHP to run graphical applications in headless mode. Why do we need Xvfb with PHP? PHP is a server-side scripting language and doesn't provide any direct support for graphics and user interfaces. Most of PHP-based web applications are built on top of popular ... Read More

How to add more values to the array on a button click using PHP?

Diksha Patro
Updated on 17-Feb-2023 10:41:13

4K+ Views

A server-side scripting language that is frequently used for web development is called PHP (Hypertext Preprocessor). The server runs PHP code, which produces HTML, CSS, and JavaScript, which are then transmitted to the client's browser for rendering. Before the HTML is transmitted to the client's browser, PHP code is embedded in it and executed on the server. To add more values to an array on a button click using PHP, you can use a form with a button that, when clicked, sends a request to a PHP script that adds the new value to the array. Approaches When using PHP, ... Read More

How does Python compare to PHP in ease of learning for new programmers?

Vikram Chiluka
Updated on 31-Jan-2023 18:08:35

293 Views

In this article, we will learn In terms of ease of learning for new programmers, how does Python compare to PHP? Comparison of Uses and Easiness: Python vs PHP Python Python is a programming language that can be used for a variety of purposes hence it is a general-purpose programming language. Artificial intelligence, machine learning, web development, data analytics, game development, and financial predictive models are just a few of the applications. Python is used by almost all current technology organizations, including Google and Netflix. Python is a popular programming language among data scientists for data cleaning, visualizing, and creating ... Read More

How to make Laravel (Blade) text field read-only?

Shilpa Kalangutkar
Updated on 01-Sep-2022 07:20:11

2K+ Views

Blade is a template engine that helps you to build your view display in laravel. It also helps you to use php code inside the template. The blade templates are saved as filename.blade.php and are stored inside resources/views/ folder. To understand the above question let us create a view calling the blade template. Example 1 Inside routes/web.php I have created the following route that is calling the view hello with data ['mymsg' => 'Welcome to Tutorialspoint']. Route::get('hello', function () { return view('hello', ['mymsg' => 'Welcome to Tutorialspoint']); }); The hello.blade.php is inside resources/views folder − {{$mymsg}} ... Read More

How to remove a parameter from all Request Objects at Controller Level in Laravel?

Shilpa Kalangutkar
Updated on 01-Sep-2022 07:17:27

5K+ Views

To get all the field values from the html form you can make use of the Request class. The class Illuminate\Http\Request; has to be included in your controller. Example 1 This example shows the student registration form and it has fields like name, email, age and address. Student Form @if (count($errors) > 0) @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif Student Registration Name Email Age Address The StudentController class is as follows −

How to validate aninput field if the value is not NULL in Laravel?

Shilpa Kalangutkar
Updated on 01-Sep-2022 07:14:03

3K+ Views

To validate data you can make use of the Validation class. The validation helps to validate data as well as to display error messages to the user. Example 1 In the example below the make() method is used. The first argument is the data to be validated and the second is the rule applied on the data : name. $validator = Validator::make( array('name' => 'Disha'), array('name' => 'required|min:5') ); As per the above the name assigned is Disha. As per the rule the name is mandatory and the minimum characters required is 5. ... Read More

How to validate exact words in Laravel?

Shilpa Kalangutkar
Updated on 01-Sep-2022 07:11:53

3K+ Views

To validate data you can make use of the Validation class. The validation helps to validate data as well as to display error messages to the user. To get the exact words to validate you can make use of Rule::in method available with laravel. Using Rule::in method whatever the values provided by this rule has to be matched otherwise it will fail. Example 1 working with Rule::in method To work with Rule::in method you need to include the class : use Illuminate\Validation\Rule; or use Rule; $input = [ 'category' => ['ABC', 'XYZ'], ]; Validator::make($input, [ ... Read More

How to validate Route Parameters in Laravel?

Shilpa Kalangutkar
Updated on 30-Aug-2022 14:38:13

11K+ Views

In laravel the routes are defined inside routes/ folder.The routes are defined inside web.php file. The file is created when the laravel installation is done. Laravel routes take in a URI and a closure function as shown below − use Illuminate\Support\Facades\Route; Route::get('/student', function () { return 'Hello Student'; }); The routes defined inside web/routes.php are assigned a web middleware group and they have session states and CSRF protection. You can also call your controller inside routes as shown below − use Illuminate\Support\Facades\Route; use App\Http\Controllers\StudentController; Route::get('student', [StudentController::class, 'index']); Following are the route methods you can make ... Read More

Advertisements