Hacker rank - Left rotation - PHP code feedback
Performance

Shifting the content of an array is a very expensive operation.
Lot's of assignments.

Realize that you don't really need to shift the content.
You can shift an offset index,
and use that shifted offset to print the desired output:

for ($i = 0; $i &lt; $n; $i++) {
    $shifted = ($i + $k) % $n;
    printf("%d", $a[$shifted]);

    if ($i &lt; $n-1) printf(" ");
}


Unnecessary statements

This is unnecessary, it serves no purpose at all, you can safely delete it:


$i; $j; $temp;



Input validation

Although input validation is a good practice,
in an online challenge you can trust that the input will be in the described format, and all values will be within the described ranges.
I haven't seen an exception to that yet.
So you don't need this kind of code:


if($n&lt;0 || $n&gt;1000000 || $k&lt;0|| $k&gt;1000000 || count($a) &lt;=0)
    exit;



Formatting

The code is very poorly formatted:


Indentation is inconsistent
No spaces between operators make it look extremely compact and hard to read


Try to follow the writing style of the snippet in my first point.