help with for loop? php

Tags
is totally not admin posting to make fake activity 
Labels
Members allowed to view this conversation
Everyone

Need guides on learning how for loops work and when I should be using them… is the main reason why im not learning php.

here's what I got so far:

<?php

$message = "The raids will never stop";

for (i < 5) {
$characTer = substr($message,i,1);
if(characTer == '\0') break;
else {
echo $characTer;
}
}

return 9;
?>


Adolf Hitler

3 weeks ago (edited by Adolf Hitler 3 weeks ago) Moderator

Well, this is not when you should be using them. Here:

<?php

$message = "The raids will never stop";

echo($message);

?>

Or better yet:

<?php

echo("The raids will never stop");

?>

Adolf Hitler - go to this post

Well, this is not when you should be using them. Here:

<?php

$message = "The raids will never stop";

echo($message);

?>

Or better yet:

<?php

echo("The raids will never stop");

?>

No.


what a capitalist language. dollar signs EVERYWHERE!!!!

your for loop is bad. what is i? need to define it.

PHP is not C where every char[] is null terminated.


Hey! You need to log in or create an account to do anything on this forum.

5,125 posts - 1,168 conversations - 2 members online

  • Display avatars