I have this result of a query
$consulta .= '<td>' . $v . '</td>';
where the variable ' . $v . '
is a number that contains leading zeros, so that excel recognizes that number in text format, I must add an apostrophe 'before the number the problem is that php separates the variables with apostrophes, like I insert the apostrophe before the variable something like this but it generates an error because the apostrophe does not close in php: ' ' . $v . '
the result of the query should look like this: '000018
while($row = mysqli_fetch_assoc($stmt)){
$data[$i]['id'] = $i;
$data[$i]['codigo_op'] = $row['codigo_op'];
$data[$i]['entrega01_clave'] = $row['entrega01_clave'];
$data[$i]['descripcion_articulo'] = $row['descripcion_articulo'];
$i++;
}
only the code_op field must have the apostrophe before the number