Jump to content

AquariaXI

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by AquariaXI

  1. Hi! So what I'm trying to do is split a multi dimensional array of strings ( each containing 3 strings inside of 1 array ) so I can write the results to a file. So say I had a bunch of strings inside 1 array : class File { function WriteFile ( $filename, $content ) { $list = [ $content ]; $delimiters = File :: checkDelimiter ( $content, true, false ); $fp = fopen ( $filename, 'w' ); foreach ( $list as $fields ) { $fields = File :: SplitFileByDelimiter ( $fields, ",", 3 ); file_put_contents ( $filename, $fields ); } fclose ( $fp ); } } $file-> File :: WriteFile ( $filepath . $filename, "TEST!, TEST!, TEST!, " . "TEST!, TEST!, TEST!, " . "TEST!, TEST!, TEST!" ); Instead of writing : TEST!, TEST!, TEST!, TEST!, TEST!, TEST!, TEST! ,TEST!, TEST!, TEST! to the file in a straight line, it should write it like this : TEST!, TEST!, TEST!, TEST!, TEST!, TEST!, TEST!, TEST!, TEST! Any help is ABSOLUTELY appreciated!
  2. Ah thanks, @requinix! That fixed it!
  3. yes i wrote the code for the mainframedata class. I'm just not understanding what & / or how you're trying to tell me what to do.
  4. @requinix: I don't understand...
  5. It is written on index.php which is separate but here it is : <?php $mfrdata = new MainframeData ( ); ?> <h1><?php echo "AppTitle :: " . $mfrdata -> get_appTitle ( ); ?></h1><br> <hr><br>
  6. Yes & it returns nothing at all.
  7. Hi, I'm new here! So I'm trying to create a class & I need to grab the title of my program through `get_appTitle ( )` whose data is changed by `__InitializeData ( )` How can I do that? <?php class MainframeData { public $appTitle; public $appName = "App Name"; public $version = "1.0"; public $verPrefix = ""; function __construct ( ...$params ) { $this -> param = $params; } function get_appTitle ( ) { return $this -> appTitle; } function __InitializeData ( ) { if ( $this -> verPrefix !== "" && empty ( $this -> verPrefix ) === false ) { $this -> appVer = ( $this -> version . " { " . $this -> verPrefix . " } " ); $this -> appTitle = $appName . " - " . "Version" . " " . $appVer; } if ( $this -> verPrefix !== "" || empty ( $this -> verPrefix ) === true ) { $this -> appVer = $this -> version; $this -> appTitle = $this -> appName . " - " . " { " . "Version" . " " . $this -> appVer . " } "; } } } $mfrdata = new MainframeData ( ); $mfrdata -> __InitializeData ( ); ?> Any help is GREATLY appreciated!
×
×
  • 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.