Continued a bit:

- recommended way is to use foreach() instead of own looping through arrays
- even when you need the index:
<?php
foreach ($someArray as $key => $value) {
	// Handle $key/$value somehow
}
?>

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-03-31 20:36:01 +02:00
parent 6db3d72ee3
commit 8824da8962
No known key found for this signature in database
GPG Key ID: B72F8185C6C7BD78
1 changed files with 5 additions and 5 deletions

View File

@ -581,8 +581,8 @@ function item_post(App $a) {
* Robert Johnson should be first in the $tags array * Robert Johnson should be first in the $tags array
*/ */
$fullnametagged = false; $fullnametagged = false;
for ($x = 0; $x < count($tagged); $x ++) { foreach ($tagged as $nextTag) {
if (stristr($tagged[$x],$tag . ' ')) { if (stristr($nextTag, $tag . ' ')) {
$fullnametagged = true; $fullnametagged = true;
break; break;
} }