Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

pbb76

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    pbb76 got a reaction from Weedy101 in Reading associative arrays?   
    Thanks to both the replies, but this was brilliantly detailed and works spot on - thank you so much Yakindo for going into so much detail, really appreciate it!
  2. Like
    pbb76 reacted to jalal in Reading associative arrays?   
    Hi
    This will do what you want:
    echo $new_invoice[0]['LineItems']['LineItem'][0]['Description']; For adding new line items I would go with something like this:
    $new_invoice[0]['LineItems']['LineItem'][] = array( 'Description' => 'Sales - Beer Glass', 'Quantity' => '10.00', 'UnitAmount' => '22.00', 'AccountCode' => '400'); Although I will note the naming of your arrays is a little off...
     
    HTH, jalal
  3. Like
    pbb76 reacted to Yakindo in Reading associative arrays?   
    In answering the title of your thread, the best way I've found to read arrays is using the function print_r();:
    <?php $array_var = array(); // the var which stores the array ?> <pre><?php print_r($array_var); ?></pre> This will output the array in an easy-to-read format, where all the keys you need to access the array items are defined.
     
    For this array:
    <?php $new_invoice = array( array( "Type"=>"ACCREC", "Contact" => array( "Name" => "Income" ), "Date" => "2013-12-31", "DueDate" => "2013-12-31", "Status" => "DRAFT", "LineAmountTypes" => "Exclusive", "LineItems"=> array( "LineItem" => array( array( "Description" => "Sales - Wet", "Quantity" => "1.0000", "UnitAmount" => "2500.00", "AccountCode" => "200" ), array( "Description" => "Sales - Pool Table", "Quantity" => "1.0000", "UnitAmount" => "325.25", "AccountCode" => "200" ) ) ) ) ); ?> <pre><?php print_r($new_invoice); ?></pre> The following is outputted in the HTML:
    Array ( [0] => Array ( [Type] => ACCREC [Contact] => Array ( [Name] => Income ) [Date] => 2013-12-31 [DueDate] => 2013-12-31 [Status] => DRAFT [LineAmountTypes] => Exclusive [LineItems] => Array ( [LineItem] => Array ( [0] => Array ( [Description] => Sales - Wet [Quantity] => 1.0000 [UnitAmount] => 2500.00 [AccountCode] => 200 ) [1] => Array ( [Description] => Sales - Pool Table [Quantity] => 1.0000 [UnitAmount] => 325.25 [AccountCode] => 200 ) ) ) ) ) As you can see all of your information is stored in the 0 array key:
    $new_invoice[0] Instead of:
    $new_invoice So to access your description you will need to do the following:
    $new_invoice[0]['LineItems']['LineItem'][0]['Description']; // first line item $new_invoice[0]['LineItems']['LineItem'][1]['Description']; // second line item To add new items into your "LineItem" key, use the following code:
    $new_invoice[0]['LineItems']['LineItem'][] = array( "Description" => "", "Quantity" => "", "UnitAmount" => "", "AccountCode" => ""); To loop through the "LineItems" section, using a foreach like so would be plausable:
    <?php foreach($new_invoice[0]['LineItems']['LineItem'] as $lineItem) { $lineItem['Description']; // this is the description of the line item being looped $lineItem['Quantity']; // this is the quantity of the line item being looped $lineItem['UnitAmount']; // so on and so forth $lineItem['AccountCode']; } ?>  
     
    I hope you've found this useful.
  4. Like
    pbb76 reacted to yawnmoth in Tesco API and SFTP   
    Could you enable logging? eg.
     
     
    <?php include('Net/SFTP.php'); define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX); $ssh = new Net_SFTP('www.domain.tld'); if (!$ssh->login('username', 'password')) { exit('Login Failed'); } echo $ssh->getLog(); ?> If you could post the output that'd be great. Thanks!
  5. Like
    pbb76 reacted to DigitalSquid in Company stopping ex-employee approaching clients   
    If it was me, I'd try and cut a deal with the company. Make a counter offer - agree, for a limited time (like 6 months), not to initiate any contact with the clients but if the client initiates it, the company gets a cut of his earnings (either a flat fee or a percentage). Sort of like a 'finders fee' as he wouldn't have access to the clients if he hadn't of worked for the studio.
  6. Like
    pbb76 reacted to Renaissance-Design in "Google Search Engine Indexing" - £500?!   
    Even More Search engine discussion? Oh my.
  7. Like
    pbb76 reacted to roothost in "Google Search Engine Indexing" - £500?!   
    Extreme Money Scam! Unbelievable
  8. Like
    pbb76 reacted to cepa in Large image uploads PHP   
    i think there is no simple solution to that, and JS won't help you too much, first of all if you use php for download it has its own limitations. If i were you i would try webdav/ftp and/or java applet.
  9. Like
    pbb76 reacted to zed in Large image uploads PHP   
    you can use JS but that can be disabled of course.
     
    If it were me and there is a friendly message and I'd explained to them 100 times then there wouldn't be a 101th time. Just ignore them. If they can't read or understand what you're telling them then there's no hope. Maybe say to them that you will start billing them for your time every time they ask?
  10. Like
    pbb76 reacted to SniderDK in Anyone else get hacked often?   
    Hmmm I don't often do this, actually ive never given security work away but i also have empathy for how powerless it must make you feel, PM me some contact info (skype,gtalk or email) if you like and i will help you out for free... i wont be offended if you don't take the help of someone random
     
    I try not to expose my identity on here but will via private communications so you can check me out make sure im good and all that
     
    also... im in and out at the moment so might not reply right away
  11. Like
    pbb76 reacted to zed in Sorting 2 separate mysql tables in one list   
    extract both, stick in an array and then sort that?
  12. Like
    pbb76 reacted to Blofeld in Backing up large MYSQL Database   
    Never come across the problem myself, but how about scrapping the cron (or changing it to daily) and writing a script so that the db is backed up after X amount of INSERTs/UPDATEs?
     
    Or take it a step further and only back up the parts that have changed?
  13. Like
    pbb76 reacted to SniderDK in Backing up large MYSQL Database   
    here's a comprehensive walk through of setting it up http://www.ghacks.net/2009/04/09/set-up-mysql-database-replication/
     
    also with root/admin access to the newer phpmyadmin there is replication functions now that makes life a bit easier

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.