How can PHP be used to control case sensitivity in MySQL LIKE queries?

When performing MySQL LIKE queries in PHP, the default behavior is case-insensitive. To control case sensitivity in these queries, you can use the BINARY keyword in the query to make it case-sensitive. This can be achieved by concatenating the BINARY keyword with the column name in the WHERE clause of the SQL query.

$searchTerm = "example";
$query = "SELECT * FROM table_name WHERE BINARY column_name LIKE '%$searchTerm%'";
// Execute the query and fetch results