Jump to content

php and html tags


zephyrstudios

Recommended Posts

Hello all,

I am trying to place some html tags within my php script. When I do-I wrap with a <p> tag</p> , but then I am unable to validate the script. I have tried the tags outside the php and in the php and can't figure it out. Any help is appreciated.

 

Here is the script:

 

<?php // Script 5.0000 - age.php 

$string_story= "In the matter of prolonging human life, science has played no part whatever. Take the case history of one Bessie Singletree. At the early age of five, Bessie suddenly became six and entered school. On trolley cars her age remained at six until she was nine. When she was 11 years old, she was 12, and for the benefit of movies and railroads, she was 12 until she was 15. On her 27th birthday Miss Singletree became 24. At 40 she was 39 and remained so until she was close to 50. At 50 Bessie was 40; at 60, 55. On her 70th birthday everyone said Grandmother Singletree was pretty chipper for an octogenarian. At 75 she had her picture in the paper as the oldest woman in the county, aged 93. Ten years later she passed away at the ripe old age of 109.<br />";

$sub="At the early age of five, Bessie suddenly became six and entered school. On trolley cars her age remained at six until she was nine. When she was 11 years old, she was 12, and for the benefit of movies and railroads, she was 12 until she was 15. On her 27th birthday Miss Singletree became 24. At 40 she was 39 and remained so until she was close to 50. At 50 Bessie was 40; at 60, 55.<br />";


print ("$string_story <br />");

print strlen ("$string_story  <br />" );//print length of string

print (" <br /> $sub <br />");//print substring

print str_word_count ("<br /> $sub <br />");//print length of substring

print $sub=ucwords ("<br />$sub <br />");//print string with capitol letters

print $sub=strpos ("she", $sub);

print $sub=str_replace ('She', 'she', $sub);

print $sub=str_replace ('Was', 'was', $sub);


?>
</p>

 

In future please use the code (


) tags when including code in posts. Thank you - wildteen88

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.