Add syntax declaration to code block in README.md

pull/1/head
John Long 12 years ago
parent ad507ed46c
commit 9ef8e72f3e
  1. 30
      README.md

@ -19,17 +19,19 @@ Features
Example Example
------- -------
// Modbus master UDP ```php
$modbus = new ModbusMaster("192.168.1.1", "UDP"); // Modbus master UDP
// Read multiple registers $modbus = new ModbusMaster("192.168.1.1", "UDP");
try { // Read multiple registers
$recData = $modbus->readMultipleRegisters(0, 12288, 5); try {
} $recData = $modbus->readMultipleRegisters(0, 12288, 5);
catch (Exception $e) { }
// Print error information if any catch (Exception $e) {
echo $modbus; // Print error information if any
echo $e; echo $modbus;
exit; echo $e;
} exit;
// Print data in string format }
echo PhpType::bytes2string($recData); // Print data in string format
echo PhpType::bytes2string($recData);
```

Loading…
Cancel
Save