I have a text file. My text file contains lines with double quotes
around it. I trying to code if a line has double quotes around it Then
make it bold
My code is below and it is not working. Please Help
<?
$filename = "whatsnew.txt"; # file to read
if (file_exists($filename)) {
# Get a handle to the asdfile
$file = file($filename);
echo "<p style='font-family:Arial; font-size:x-small'>";
foreach($file as $line) {
if (strpos($line,"\"") > 0) {
$line = "<b>" . $line . "</b>";
}
$line .= "<br />";
echo $line;
}
echo "</p>";
}
?>
How to find a quote in a string
Moderator: General Moderators
Re: How to find a quote in a string
Code: Select all
if (strpos($line,"\"") > 0) {Code: Select all
if (strpos($line, "\"") !== false) {