Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>&lt;?php $str = " 2011.12.30 23:26 Victim: Annabel Lust Corp: Shadow Monolith Alliance: Shadow of xXDEATHXx Faction: None Destroyed: Cheetah System: C6CG-W Security: 0.0 Damage Taken: 827 Involved parties: Name: Milena Dush Security: 0.6 Corp: nXo Alliance: Intrepid Crossing Faction: None Ship: Hound Weapon: Caldari Navy Bane Torpedo Damage Done: 457 Destroyed items: Sisters Expanded Probe Launcher Catalyzed Cold-Gas Arcjet Thrusters Nanofiber Internal Structure II Overdrive Injector System II Hardwiring - Genolution Core Augmentation CA-2 (Cargo) Nanite Engineering (Cargo) Sisters Core Scanner Probe, Qty: 5 (Cargo) Micro Auxiliary Power Core I (Cargo) Sisters Deep Space Scanner Probe, Qty: 5 (Cargo) Dropped items: Covert Ops Cloaking Device II Sisters Combat Scanner Probe, Qty: 5 Warp Disruptor II Nanofiber Internal Structure II Astrometric Pinpointing (Cargo) Small Gravity Capacitor Upgrade I, Qty: 2 (Cargo) Salvager I (Cargo) Interceptors (Cargo) Thermodynamics (Cargo) Co-Processor I (Cargo) "; var_dump(parseItems('/Destroyed items:(?P&lt;destroyedItems&gt;.*)Dropped items:/is', $str, 1)); var_dump(parseItems('/Dropped items:(?P&lt;droppedItems&gt;.*)/is', $str, 1)); function parseItems($regex, $str, $defaultQty = 0){ preg_match($regex, $str, $match); $lines = explode("\n", $match[1]); $defaultQty = 0; $items = array(); foreach($lines as $key =&gt; $line){ $line = trim($line); if($line != ""){ $quantity = (strpos($line, "Qty:") != false) ? getQty($line) : $defaultQty; $items[] = array($line =&gt; $quantity); } } return $items; } function getQty($line){ preg_match('/, Qty:\s+(?P&lt;quantity&gt;[0-9]+)/', $line, $match); return $match['quantity']; } </code></pre> <p>This should give you an array of dropped and destroyed lines along with its quantity. It returns associative array, where key is the line and value is the quantity.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload