Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 12-08-2015, 10:14 PM   #1
Join Date: May 2015
Posts: 20
Default static method

May someone help with this particular problem please? I have to create a static method (which is called changeCase) in a class called TextFunctions that will change a given string to uppercase letters based on a pararmeter?

The code I have to use (I have to add to this code to get it to work) is as followed:

$string = "Hello, World\n";
echo TextFunctions::changeCase($string, true);
echo TextFunctions::changeCase($string, false);


All I have managed to come up with this far - is this code (as below: code #2), but while it works - output Hello, World! (all uppercase letters). I haven't managed to work into any of the above code (code#1).

class TextFunctions {
public static $string = 'Hello, World!';
static public function strtoupper() {
echo strtoupper(TextFunctions::$string);
jacob1986 is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 10:41 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com