Pesky newlines
It's interesting, looping through the labels.txt file gives us a $line that also has a \n at the end of it, thus a search for "House Finch" becomes just "House". But only on certain species? It seems that 95% of other species weren't affected by this newline. Anyways this fixes it :)
This commit is contained in:
@@ -70,7 +70,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isse
|
|||||||
// convert sci name to English name
|
// convert sci name to English name
|
||||||
foreach($lines as $line){
|
foreach($lines as $line){
|
||||||
if(strpos($line, $todaytable['Sci_Name']) !== false){
|
if(strpos($line, $todaytable['Sci_Name']) !== false){
|
||||||
$engname = explode("_", $line)[1];
|
$engname = trim(explode("_", $line)[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
|
|||||||
// convert sci name to English name
|
// convert sci name to English name
|
||||||
foreach($lines as $line){
|
foreach($lines as $line){
|
||||||
if(strpos($line, $todaytable['Sci_Name']) !== false){
|
if(strpos($line, $todaytable['Sci_Name']) !== false){
|
||||||
$engname = explode("_", $line)[1];
|
$engname = trim(explode("_", $line)[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user