Jump to content

newtophp59

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

newtophp59's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Mucho Thanks to Quick Old car.... I must have been brain dead last night....You are fabulous
  2. I created a function called converter. My code doesn't look like it processes anything after the first if . This is what is displayed in browser. Convert a String original string: roses Are red, violets are blue.... converted string: roses are red, violets are blue.... converted string: roses are red, violets are blue.... converted string: roses are red, violets are blue.... <html> <head> <title>Create a PHP Function to Convert a String</title> </head> <body bgcolor="pink"> <h2>Convert a String</h2> <?php $phrase = "roses Are red, violets are blue...."; function converter($arg1, $arg2){ if($arg1="lower"){ return strtolower($arg2); } elseif ($arg1="upper"){ return strtoupper($arg2); } else /* if($arg1="title")*/{ return ucwords($arg2); } } print "original string: ".$phrase."<br />"; print "converted string: ".converter("upper",$phrase)."<br />"; print "converted string: ".converter("lower",$phrase)."<br />"; print "converted string: ".converter("title",$phrase)."<br />"; ?> </body> </html>
×
×
  • 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.