Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11818

Re: Perform maths based on a number in a text file

Message-ID <20674060.4IAKZ2NE0I@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2013-11-18 11:57 +0100
Subject Re: Perform maths based on a number in a text file
Newsgroups comp.lang.php
References <83ddeb0e-5749-4602-bda0-e9d6770feb44@googlegroups.com>

Show all headers | View raw


drkirkby@gmail.com wrote:

> […]
> So if A was 10
> 
> 1) Page 1 should show 10
> 2) Page 2 should show 30
> 3) Page 3 should show -20.
> 
> If the value of A changes, I'd like to update the web site in one place,
> and not go around to every page updating them individually, as that will
> be error prone.
> 
> Is there a way to put the value of A in a text file, and use the value in
> different parts of the site? If so how?

<http://php.net/file_put_contents>
<http://php.net/file_get_contents>

However, it would be easier to include a constant definition.
 
> Since there will actually be 15 or so parameters, A, B, C ..., is there a
> way I can put all 15 parameters in a file (perhaps one per line, or with
> white space between them), rather than have 15 different files?

Yes.
 
> Any thoughts?

Do your own homework.

-- 
When all you know is jQuery, every problem looks $(olvable).

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-18 01:23 -0800
  Re: Perform maths based on a number in a text file Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-18 11:57 +0100
  Re: Perform maths based on a number in a text file The Natural Philosopher <tnp@invalid.invalid> - 2013-11-18 13:19 +0000
    Re: Perform maths based on a number in a text file Tim Streater <timstreater@greenbee.net> - 2013-11-18 15:08 +0000
      Re: Perform maths based on a number in a text file The Natural Philosopher <tnp@invalid.invalid> - 2013-11-18 16:22 +0000
        Re: Perform maths based on a number in a text file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-18 16:50 +0000
        Re: Perform maths based on a number in a text file Tim Streater <timstreater@greenbee.net> - 2013-11-18 16:53 +0000
    Re: Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-20 03:50 -0800
      Re: Perform maths based on a number in a text file David Robley <me@home.invalid> - 2013-11-20 22:32 +1030
      Re: Perform maths based on a number in a text file The Natural Philosopher <tnp@invalid.invalid> - 2013-11-20 13:03 +0000
      Re: Perform maths based on a number in a text file Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-20 11:20 -0500
  Re: Perform maths based on a number in a text file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-18 14:46 +0000
    Re: Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-20 03:53 -0800
  Re: Perform maths based on a number in a text file Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-18 11:38 -0500
    Re: Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-20 03:58 -0800
  Re: Perform maths based on a number in a text file Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-21 03:10 +0000

csiph-web