3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strLimit = explode(',',"rpt_Job_Tracking,rpt_Customer_Routing_Report"); $str ="<optgroup label='Billing Summary Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='JobTracking'>Job Tracking</option> <option style='color:black; font-weight:normal' value='CustomerRouting' selected>Customer Routing Report</option> <option style='color:black; font-weight:normal' value='BillingStatistics'>Billing Statistics</option> <option style='color:black; font-weight:normal' value='BranchReport'>Branch Report</option> <option style='color:black; font-weight:normal' value='BranchBilling'>Branch Billing Report</option> <option style='color:black; font-weight:normal' value='BillingActivityDetail'>Billing Activity Details</option> </optgroup> <optgroup label='e-Adoption Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='eAdoptionDashboard'>e-Adoption Dashboard</option> <option style='color:black; font-weight:normal' value='eAdoptionReport'>e-Adoption Chart</option> <option style='color:black; font-weight:normal' value='TopBillingCusts'>Top Paper Customers</option> <option style='color:black; font-weight:normal' value='TopBillingCustsAcctNum'>Top Paper Custs by Acct Num</option> <option style='color:black; font-weight:normal' value='BranchEBillReport'>Branch Electronic Report</option> <option style='color:black; font-weight:normal' value='EasyImportUsage'>EasyImport Usage</option> </optgroup> <optgroup label='eBilling and ePayment' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='OnlinePayments'>Online Payments</option> <option style='color:black; font-weight:normal' value='PaymentFile'>Payment File Report</option> <option style='color:black; font-weight:normal' value='ACHTransfers'>ACH Transfers</option> <option style='color:black; font-weight:normal' value='IGUsage'>Invoice Gateway Usage Report</option> <option style='color:black; font-weight:normal' value='ObpAccountAudit'>Online Account Audit Report</option> <option style='color:black; font-weight:normal' value='EUsageReport'>Invoice Central Usage Report</option> <option style='color:black; font-weight:normal' value='IGUsers'>Online User Report</option> <option style='color:black; font-weight:normal' value='eDSOReport'>eDSO By Month</option> <option style='color:black; font-weight:normal' value='AutoPay'>Auto Pay Report</option> </optgroup> <optgroup label='Bullpen Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='BPInvoices'>Bullpenned Invoices</option> <option style='color:black; font-weight:normal' value='BPStatistics'>Bullpen Statistics</option> </optgroup> <optgroup label='Address Reports' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='UncertifiedAddresses'>Uncertified Addresses</option> <option style='color:black; font-weight:normal' value='NCOAAddressesReport'>NCOA Addresses</option> </optgroup> <optgroup label='Miscellaneous' style='color:blue;font-weight:bold;'> <option style='color:black; font-weight:normal' value='InvoiceExtract'>Invoice Extract</option> <option style='color:black; font-weight:normal' value='FaxFailures'>Fax Failures</option> <option style='color:black; font-weight:normal' value='EmailFailures'>Transmittal Failures</option>"; $rptList = array(); $doc = new DOMDocument(); $doc->loadHTML($str); $headings = $doc->getElementsByTagName('optgroup'); $books = $doc->getElementsByTagName('option'); foreach($headings as $heading) { $parentItem = $heading->getAttribute('label'); if($heading->hasChildNodes()) { $childItems = $heading->getElementsByTagName('option'); foreach ($childItems as $childItem) { $rptList[$parentItem][] = $childItem->nodeValue; } } } print_r($strLimit); print_r($rptList);
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Array ( [0] => rpt_Job_Tracking [1] => rpt_Customer_Routing_Report ) Array ( [Billing Summary Reports] => Array ( [0] => Job Tracking [1] => Customer Routing Report [2] => Billing Statistics [3] => Branch Report [4] => Branch Billing Report [5] => Billing Activity Details ) [e-Adoption Reports] => Array ( [0] => e-Adoption Dashboard [1] => e-Adoption Chart [2] => Top Paper Customers [3] => Top Paper Custs by Acct Num [4] => Branch Electronic Report [5] => EasyImport Usage ) [eBilling and ePayment] => Array ( [0] => Online Payments [1] => Payment File Report [2] => ACH Transfers [3] => Invoice Gateway Usage Report [4] => Online Account Audit Report [5] => Invoice Central Usage Report [6] => Online User Report [7] => eDSO By Month [8] => Auto Pay Report ) [Bullpen Reports] => Array ( [0] => Bullpenned Invoices [1] => Bullpen Statistics ) [Address Reports] => Array ( [0] => Uncertified Addresses [1] => NCOA Addresses ) [Miscellaneous] => Array ( [0] => Invoice Extract [1] => Fax Failures [2] => Transmittal Failures ) )
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Array ( [0] => rpt_Job_Tracking [1] => rpt_Customer_Routing_Report ) Array ( [Billing Summary Reports] => Array ( [0] => Job Tracking [1] => Customer Routing Report [2] => Billing Statistics [3] => Branch Report [4] => Branch Billing Report [5] => Billing Activity Details ) [e-Adoption Reports] => Array ( [0] => e-Adoption Dashboard [1] => e-Adoption Chart [2] => Top Paper Customers [3] => Top Paper Custs by Acct Num [4] => Branch Electronic Report [5] => EasyImport Usage ) [eBilling and ePayment] => Array ( [0] => Online Payments [1] => Payment File Report [2] => ACH Transfers [3] => Invoice Gateway Usage Report [4] => Online Account Audit Report [5] => Invoice Central Usage Report [6] => Online User Report [7] => eDSO By Month [8] => Auto Pay Report ) [Bullpen Reports] => Array ( [0] => Bullpenned Invoices [1] => Bullpen Statistics ) [Address Reports] => Array ( [0] => Uncertified Addresses [1] => NCOA Addresses ) [Miscellaneous] => Array ( [0] => Invoice Extract [1] => Fax Failures [2] => Transmittal Failures ) )

preferences:
201.19 ms | 405 KiB | 330 Q