diff --git a/api/pipe.php b/api/pipe.php
index 2c43e56814f959b3db8dde643750ac64c8d4d20d..d7d4b33be96644c484c846d47bf36179829ccdc2 100644
--- a/api/pipe.php
+++ b/api/pipe.php
@@ -117,7 +117,7 @@ if(!$ticket){ //New tickets...
 }
 //Ticket created...save attachments if enabled.
 if($cfg->allowEmailAttachments() && ($attachments=$parser->getAttachments())) {
-    foreach($attachments as $k=>$attachment) {
+    foreach($attachments as $attachment) {
         if($attachment['filename'] && $ost->isFileTypeAllowed($attachment['filename']))
             $ticket->saveAttachment(array('name' => $attachment['filename'], 'data' => $attachment['body']), $msgid, 'M');
     }
diff --git a/include/class.faq.php b/include/class.faq.php
index 06be159044c337cb9c102c7864edf0445c8d08be..2197bbac102604d334d2f59b71d7658a3b18b39b 100644
--- a/include/class.faq.php
+++ b/include/class.faq.php
@@ -135,7 +135,7 @@ class FAQ {
 
         if($ids) {
             $topics = $this->getHelpTopicsIds();
-            foreach($ids as $k=>$id) {
+            foreach($ids as $id) {
                 if($topics && in_array($id,$topics)) continue;
                 $sql='INSERT IGNORE INTO '.FAQ_TOPIC_TABLE
                     .' SET faq_id='.db_input($this->getId())
@@ -163,7 +163,7 @@ class FAQ {
         //Delete removed attachments.
         $keepers = $vars['files']?$vars['files']:array();
         if(($attachments = $this->getAttachments())) {
-            foreach($attachments as $k=>$file) {
+            foreach($attachments as $file) {
                 if($file['id'] && !in_array($file['id'], $keepers))
                     $this->deleteAttachment($file['id']);
             }
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 5ea192c366420f32949cca4558a2f6868808816c..93543690414914fe49a3d00e1e4664dd9e8f7a2c 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1408,7 +1408,7 @@ class Ticket{
 
         //Canned attachments...
         if($vars['cannedattachments'] && is_array($vars['cannedattachments'])) {
-            foreach($vars['cannedattachments'] as $k =>$fileId)
+            foreach($vars['cannedattachments'] as $fileId)
                 if($fileId && $this->saveAttachment($fileId, $respId, 'R'))
                     $attachments[] = $fileId;
         }