PHP code example of ksfraser / contact-dto

1. Go to this page and download the library: Download ksfraser/contact-dto library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ksfraser / contact-dto example snippets


use Ksfraser\Contact\DTO\ContactData;

$contact = new ContactData();
$contact->name = 'ACME Corp';
$contact->email = '[email protected]';
$contact->phone = '555-0123';
$contact->contact_type = 'vendor';

// Record a transaction
$contact->recordTransaction(150.00, '2023-06-15 10:30:00');

// Export to database
$data = $contact->toArray();