How can column titles be stored in an array in PHP?

To store column titles in an array in PHP, you can simply create an array variable and assign the column titles as values to the array elements. This allows you to easily access and manipulate the column titles in your code.

// Store column titles in an array
$columnTitles = array("Title 1", "Title 2", "Title 3");

// Accessing column titles
echo $columnTitles[0]; // Output: Title 1
echo $columnTitles[1]; // Output: Title 2
echo $columnTitles[2]; // Output: Title 3