Activity Stream
48,167 MEMBERS
6714 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1.     
    #1
    Member
    Website's:
    maxneeds.info

    Question How would you translate this in PHP ?

    For first value in $var do something...


    I think it is subarray.. like - $entry_array[ 'entry' ] .. So t3od0r how to choose the first or any other value.. And btw the values are actually all entries/pages of content.

    I think if($entry_array[ 'entry' ][0]) works but if i want to do this ---

    if($entry_array[ 'entry' ][0]){$entry_array[ 'entry' ][0]=$entry_array[ 'entry' ][0].'TEST';}
    it adds 'TEST' to all entries not the first one...(maybe because the code like this means 'if exist'?)
    Porsche_maniak Reviewed by Porsche_maniak on . How would you translate this in PHP ? For first value in $var do something... I think it is subarray.. like - $entry_array .. So t3od0r how to choose the first or any other value.. And btw the values are actually all entries/pages of content. I think if($entry_array) works but if i want to do this --- if($entry_array){$entry_array=$entry_array.'TEST';} it adds 'TEST' to all entries not the first one...(maybe because the code like this means 'if exist'?) Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Wat is $var
    an array, phrase...


  4.     
    #3
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    first value in $var?
    then $var is an array right? $var = array("1","2","3");
    first value : $var[0] -> will show 1

  5.     
    #4
    Member
    Website's:
    btjunk.net
    I think he want to do something with firs array value, not sure about that.

  6.     
    #5
    Member
    Website's:
    maxneeds.info
    I think it is subarray.. like - $entry_array[ 'entry' ] .. So t3od0r how choose the first or any other value.. And btw the values are actually all entries/pages of content.

    I think if($entry_array[ 'entry' ][0]) works but if i want to do this ---

    if($entry_array[ 'entry' ][0]){$entry_array[ 'entry' ][0]=$entry_array[ 'entry' ][0].'TEST';}
    it adds 'TEST' to all entries not the first one...(maybe because the code like this means 'if exist'?)

  7.     
    #6
    Member
    Depends on the keys used for the elements in the array. Keys, by default, are incrementing integers.

    PHP Code: 
    // Incremental integer keys assigned by PHP
    $fruits = array( 'Apple''Orange''Banana' );

    echo 
    $fruits[0];
    // Output: Apple

    echo $fruits[1];
    // Output: Orange 
    PHP Code: 
    // Explicitly assigned keys
    $fruitColors = array(
        
    'Apples' => 'red',
        
    'Oranges' => 'orange',
        
    'Bananas' => 'yellow'
    );

    echo 
    $fruitColors'Apple' ];
    // Output: red

    foreach( $fruitColors as $fruit => $color )
    {
        echo 
    $fruit ' are <span style="color:' $color ';">' $color '</span>.<br />' "\n";

    Output:
    Apples are red.
    Oranges are orange.
    Bananas are yellow.

  8.     
    #7
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    PHP Code: 
    $result = (isset($var[0]) ? $var[0] : null); 
    by the way you explained it you might want

    PHP Code: 
    for($i=0;$<=count($var);$i++)
    {
        switch(
    $i)
        {
            case 
    0:
                
    //First item here
                
    $var[$i] = strtolower($var[$i]);
            break;
            default:
                
    //All other elements in the array
                
    $var[$i] = strtoupper($var[$i])
            break;
        }

    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  9.     
    #8
    Member
    Website's:
    epicimagehost.com
    Isn't he talking about multidimensional arrays?

  10.     
    #9
    Member
    Then we have multidimensional arrays.

    PHP Code: 
    // Two-dimensional array
    $produce = array(
        
    'fruits' => array( 'Apples''Oranges''Bananas' ),
        
    'vegs' => array( 'Tomatos''Potatos''Carrots' )
    );

    echo 
    $produce'fruits' ][0];
    // Output: Apples

    echo $produce'vegs' ][2];
    // Output: Carrots 

  11.     
    #10
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Multidimensional arrays still have an index of numerics as well as strings so example

    PHP Code: 
    $user = array(
        
    'dob' => 25121988,
        
    'age' => 21,
        
    'profile' => array(
            
    'username' => 'litewarez'
        
    )
    );

    $profile_1 $user['profile']; //array(username ...)
    $profile_2 $user[2]; //array(username ...)

    //the same 
    try do this
    PHP Code: 
    print_r($entry_array); 
    to see the contents
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Translate page
    By skinner in forum Web Development Area
    Replies: 1
    Last Post: 1st May 2012, 01:35 PM
  2. How to translate a template ?
    By Debaldus in forum DLE
    Replies: 9
    Last Post: 20th Feb 2012, 07:58 PM
  3. need translate script
    By peterpetroli in forum Web Development Area
    Replies: 5
    Last Post: 29th Dec 2011, 03:39 AM
  4. DLE translate tuto
    By milooot in forum Webmaster Discussion
    Replies: 3
    Last Post: 3rd Aug 2011, 05:23 PM
  5. Can someone translate this for me
    By kohkindachi in forum Technical Help Desk Support
    Replies: 2
    Last Post: 3rd Oct 2010, 01:34 PM

Tags for this Thread

BE SOCIAL