Chat with our AI personalities
You can do this: <?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
< ?php // This is an example of comment in PHP /* This is another example of comment in PHP and we can write comments in multiple lines using this method */ ? >
Code Below: <?php $j = 100; // Set limit upper limit echo "Even Numbers are: <br/>"; for($i=1;$i<=$j;$i++) { if($i%2) { continue; } else { echo $i."<br/>"; } } ?>
To learn PHP it is best to read a few tutorials and then start trying out the things you read about. For instance, make a program that does some calculations and then prints the result on the screen. A good tutorial to start with can be found on: http://w3schools.com/php/default.asp or http://www.geekatude.com/PHP or http://php.net or http://www.phpmysqlbrain.com You can install the things in your local system , and then by referring the above websites try to write codes and see the results.