-1

Below is the program i have created using PHP.

foreach (.$resource->getAttributeMap()->entrySet() as .$entry);
if($entrey->getkey()->equal($Resource->RESOURCE_ID_KEY))
    continue;
echo".$entry->getkey(). $entry->getValue()[0]";

The program can't iterator for each. How to the solve the issue?

  • please paste the previous lines of code, the error will be there – delboy1978uk Oct 22 '18 at 10:14
  • and whats that `.` at the start of the foreach? that looks wrong – delboy1978uk Oct 22 '18 at 10:15
  • check line number 53 code. possible missing `;` and also remove `.` in foreach loop – Bilal Ahmed Oct 22 '18 at 10:15
  • `foreach ($resource->getAttributeMap()->entrySet() as $entry);` the `;` ends your loop it's like doing `foreach ($resource->getAttributeMap()->entrySet() as $entry){}` Based on how bad this one snip-it is, I hazard to say there are many many errors. (don't take that personally, i'm just making an observation, we all have to start somewhere) – ArtisticPhoenix Oct 22 '18 at 10:42

1 Answers1

0

The actual context of the code is not clear but it has syntax errors like .(dot) preceding the variable names, not consistent variable names etc. A modified code would be :

foreach ($resource->getAttributeMap()->entrySet() as $entry){
    if($entry->getkey()->equal($resource->RESOURCE_ID_KEY)){
       continue;
    }
    echo $entry->getkey()."". $entry->getValue()[0];
 }
Prakash S
  • 632
  • 6
  • 12