PHP logo

PHP.  It’s been a little while since I had to deal with you but, seriously, is this really a thing?

[php]$value = 10;
$temp = 0;
 
for($ctr = 0; $ctr < $value; $ctr++) {

echo "value + ctr: " . $value + $ctr . "<br>";
// this doesn’t work?!

$temp = $value + $ctr;
echo "value + ctr: " . $temp . "<br>";
// … but this does work?

}[/php]

Perhaps (hopefully) things have changed in PHP7?

this week (wk 7)

work

  • General
  • CRM
    • System:
    • Sales
      • Marketing/Intro letter to local .org.uk’s
  • Systems:
    • Update shared accounts to new limits
    • Check and update VS disk space
  • PHP
    • Admin panel tasks
      • build – complete eCommerce
      • test
      • release
    • Checkout testing
  • [recurring] Organise
    • networking group training
    • changes to web site
    • arrange visitors
    • sales leads / prospects / meetings for next week  

life

misc

last week (wk 6)

work

  • CRM
  • Systems:
    • Update shared accounts to new limits
    • Check and update VS disk space
  • PHP
    • Admin panel tasks
      • build (ongoing)
      • test
      • release
    • Checkout testing
  • [recurring] Organise
    • networking group training 
    • arrange visitors
    • sales leads / prospects / meetings for next week  

life

misc

this week (wk 6)

work

  • System:
  • Sales
    • Arrange 1-2-1s with visdes’s
    • Marketing/Intro letter to local .org.uk’s
  • Systems:
    • Update shared accounts to new limits
    • Check and update VS disk space
  • PHP
    • Admin panel tasks
    • build
    • test
    • release
  • Checkout testing
  • [recurring] Organise
    • networking group training
    • arrange visitors
    • sales leads / prospects / meetings for next week  

    life

    misc

    last week (wk 5)

    work

    • System:
  • Sales
    • 1-2-1s with visdes’s
    • Tie down opps
  • Systems:
    • Update shared accounts to new limits
    • MTA switch
    • Check and update VS disk space
  • PHP
    • Admin panel tasks
    • build (in progress)
    • test
    • release
  • Checkout testing
  • [recurring] Organise
    • networking group training 
    • arrange visitors
    • sales leads / prospects / meetings for next week  

    life

    misc

    /lib/ld-linux.so.2 missing? libXext.so.6 can’t be found?

    I recently [at the original time of writing] installed Fedora 11 [x86_64] on a test machine, to see how the development desktop build of my favourite Linux distribution is doing – and it’s very nice indeed.

    I tried to install Zend Studio 5.5 and soon came across problems, which I found out related to not having 32-bit versions of Xorg and glibc installed. To remedy this, ensure you follow these steps:

    su -c 'yum groupinstall Java'
    su -c 'yum install glibc.i686 libXext.i586'

    Once installed, I was able to fire up the Zend Development Environment:

    /usr/local/Zend/ZendStudio-5.5.1/bin/ZDE

    .. and it was running on the native (OpenJDK) 64-bit JAVA runtime! How’s that for progress!

    This week
    Work
    • [ ] Refine some elements on Zend Framework eCommerce system
    • [ ] Prepare 10 min presentation
      Zend Framework logo.
    • [ ] Arrange projector / screen
  • [ ] Attend networking event
  • [ ] Set up sales meeting
  • [ ] Finances
  • [ ] Progress Christmas cards
  • [ ] Catch-up phone calls
  • Life

    • [ ] Food shop
    • [ ] Swimming x 2
    • [ ] Kung Fu

    Misc

    • [ ] Get presents/cards
    • [ ] Cook something I’ve never cooked before
    • [ ] Tidy up downloads/images
    • [ ] Time to wash the car / dog (?)
    Enhanced by Zemanta

    I remember once watching a documentary on Arnold Schwarzenegger’s bodybuilding career (or was it this one?) in the ’70s and early ’80s.

    All of the bodybuilders in that golden era had their own training programme managers and promoters.  I recall that one manager/promoter, working for another bodybuilder, loved his own quotes.

    These quotes would range from the urbane, “the pen is mightier than the muscle”, to somewhat more characteristically humorous: “remember the golden rule: he who has the gold, makes the rules“.

    Well, in the completely unrelated world of PHP programming, this perl of wisdom (sic joke) is worth hanging on to.  Why?  Well, if you have ever used PHP’s variable variables, knowledge of the correct syntax is worth its weight in gold.  It’ll save hours, if not days, of debugging.
    So, anyway, I’ve been coding a calendar system for a valued client for the past ten days or so.  My first attempt I pretty much scrapped as it got too complex and almost impossible to debug.  The second version is much better, except for one issue which has been giving me grief until now.

    Variable variables in PHP are extremely useful, but I throw in a word of caution immediately: use them sparingly.  It can be easy to quickly lose track of what’s called what and why it’s there.  Especially if any single script is 400+ lines long.

    To set a variable variable, it’s easier to start off giving a value to an ordinary variable:

    $myVar = "myVarVar";

    Now, I want to create a variable variable with the name $myVarVar, so this is how it’s done:


    $$myVar = "this is my variable variable";

    To see the contents of the variable variable, you can do either of the following:


    echo $$myVar;     // or
    echo $myVarVar; 

    Both will output “this is my variable variable” to the screen/page.

    Snooker Loopy
    Things start getting interesting when you introduce arrays and loops. Take the following example:


    for($i=0; $i<4; $i++) {
    $myVar = "myVarVar".$i;
    $$myVar = "  Variable variable £".$i;
    }

    creates and produces:

    echo $myVarVar0; // "Variable variable #0"
    echo $myVarVar1; // "Variable variable #1"
    echo $myVarVar2; // "Variable variable #2"
    echo $myVarVar3; // "Variable variable #3"

    Stencil of a shopping cart with the head of th...I

    Last week

    Work

    • [X] It’s all about the shopping cart system :-), but if there’s any time left…
    • [X] Organise and attend various 1-2-1 meetings
    • [-] Update CRM database with new data/purge old
    • [-] Modify company site (content/volume/images)
    • [-] Price review
    • [ ] Review marketing and sketch out action plan
    • [-] Finish templates for sales process
    • [-] Finish help documentation for new web-based calendar tool

    Life

    • [ ] Continue documentation effort for F/LOSS project
    • [X] Kung Fu – reacquaint myself with yellow sash routines
    • [ ] Swimming x 2

    Misc

    • [ ] Cook something I’ve never cooked before
    • [ ] Test a couple of lenses for the DSLR

    This week

    Intentionally short in number but still high in volume.
    Work

    • [ ] Continue the Zend Framework shopping cart system
    • [ ] Produce marketing data
      – [ ] Mail merge
      – [ ] Review & print
      – [ ] Envelope
    • [ ] Attend networking training
    • [ ] Attend other networking event (optional)

    Life

    • [ ] Continue documentation effort for F/LOSS project
    • [ ] Swimming x 1
    • [ ] Attend wedding party

    Misc

    • [ ] Get presents/cards
    • [ ] Cook something I’ve never cooked before
    • [ ] Test a couple of lenses for the DSLR
    Enhanced by Zemanta

    In every day life, I come across a number of things that I find extremely useful.  Instead of clogging up my browser’s bookmarks, I’ll list there here for my reference.

    I hope they might be of use to you too!

    Programming

    • PHP
  • Flex