Want this question answered?
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
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/>"; } } ?>
You can do this: <?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }
To print a particular value in PHP you have to select which variable you wish to print. Below is an example of how this can be done. <?php $var[1] = "Hello"; $var[2] = "Lalala"; print $var[2]; // prints Lalala but not Hello ?>
< ?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 */ ? >
echo or print < both of which write text: <?php echo "TEXT"; print "TEXT"; ?>
// example of 1..12x12 table for($i = 1; $i <= 12; $i++) { for($j = 1; $j <= 12; $j++) { print ($i * $j) ." "; } print "\n"; }
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
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/>"; } } ?>
It is really simple to print an HTML table in PHP, all you have to do is the following: <?php print "<table>"; print "<tr>"; print "<td>hello</td>"; print "</tr>"; print "</table>"; ?>
well, as such there is no Widget in php. You need to write your own widget program if you are interested to develop. You must be aware of wordpress built on php plateform and that uses widget extensively :)
You can do this: <?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }
To print a particular value in PHP you have to select which variable you wish to print. Below is an example of how this can be done. <?php $var[1] = "Hello"; $var[2] = "Lalala"; print $var[2]; // prints Lalala but not Hello ?>
<pre> <?php $limit = 100; $primeList = array(); for($i = 2; $i < round(sqrt($limit)); $i++) { foreach($primeList as $num) { if($i%$num 0)) continue 2; } $prime[] = $i; } print_r($prime); ?> </pre> Based on Sieve of Erathosthenes. See the related link for further information.
Ratinonal program in php
$n = 10*(1+10)/2;
We can write php extension is many way... .php , .php5, .php4