Jump to content


Photo
- - - - -

Simple PHP class.


  • Please log in to reply
No replies to this topic

#1 iPoptart

iPoptart

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 18 June 2005 - 01:42 PM

This class will add <BR /> after each character in a string. Here is the code, it is commented well enough! You have to have atleast SOME knowledge of OOP.



<?PHP
//Start a new class
class VertLetters
{
//Start the function
  function VerticalLetters($text) 
  {
//Wordwrap the string!
     $newtext = wordwrap($text, 1, '<BR \>', 1);
//Echo it
     echo $newtext;
  }//Close the function
}//Close the class

//Call the class
$this = new VertLetters;
//Change some text!
$this -> VerticalLetters('Test');





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users