Unable to undertstand a certain code regarding php classes

Discussion in 'PHP' started by more_sem, Dec 2, 2009.

  1. #1
    Hi,
    I have a open source script and there is usage of certain code which I am unable to understand
    Firstly in a given class lets say
    class Testing {
        var $wacko         = "";           //Some variable value declaration
        var $trick       = 'I am going nuts';  //Some text
        var $doom         = "";           //Some variable value declaration
        var $toon         = "";           //Some variable value declaration
        var $croon         = "";           //Some variable value declaration
        var $tune         = "";           //Some variable value declaration
        var $mess        = false;           //Some variable value declaration
        var $code     ="<form action='nutsy.php' method='get'><p>
        <input type='hidden' name='abc' value='1' />
        <input type='text' name='def' value='%4\$s' size='30' />
        <input type='submit' value='go' /><br />
        <br/>
    </p></form>";
    
    Code (markup):
    I am unable to understand from where the value of %4\$s
    is derived in the above code.
    Where would i find a tutorial for using such type of coding?
    There are other instances of
    %1\$s
    %2\$s
    %3\$s
    Code (markup):
    being used in the code, but I am unable to figure out how exactly they are calculated, referred or valued. This certain code of a php class has given me alot of problem :(
    Please help, this brain wacko script is too difficult to understand.
     
    more_sem, Dec 2, 2009 IP
  2. Sergey Popov

    Sergey Popov Peon

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There must be some method(s) of the child class(es) that uses $code value to substitute instances like %4\$s
     
    Sergey Popov, Dec 2, 2009 IP