How to display string values within a table using PHP ? (original) (raw)

Last Updated : 26 May, 2021

A table is an arrangement of data in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research, and data analysis.

Approach: Use HTML table elements inside PHP echo to print the string values in a table. We can write HTML tags inside a PHP script to display the output rendered as an HTML component.

PHP code:

PHP `

$var1 is best learning platform Written by $var2 "; ?>

`

Output:

Geeksforgeeks is best learning platform
Written by Priyank

If we run this code on a local server then the output will display in form of a table.