PageSourceSearch

https://tradingcardapi.com/assets/js/7ae21dc5.a4beddb0.js

js tradingcardapi.com collected 2026-10-04 19:31:41 UTC 21,900 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunktradingcardapi_public_docs||=[]).push([[3661],{6417(e,n,a){a.r(n),a.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>u,frontMatter:()=>i,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"examples/php","title":"PHP Examples","description":"Practical PHP snippets for querying sports card data and the wider trading card catalog through the Trading Card API.","source":"@site/docs/examples/php.md","sourceDirName":"examples","slug":"/examples/php","permalink":"/docs/examples/php","draft":false,"unlisted":false,"editUrl":"https://github.com/cardtechie/tradingcardapi-api/tree/master/docs/public/docs/examples/php.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"cURL Examples","permalink":"/docs/examples/curl"},"next":{"title":"JavaScript Examples","permalink":"/docs/examples/javascript"}}');var s=a(4848),r=a(8453);const i={},c="PHP Examples",d={},l=[{value:"Authentication",id:"authentication",level:2},{value:"Using Personal Access Token (Recommended for Development)",id:"using-personal-access-token-recommended-for-development",level:3},{value:"Using OAuth 2.0 Client Credentials (Recommended for Production)",id:"using-oauth-20-client-credentials-recommended-for-production",level:3},{value:"Basic Usage",id:"basic-usage",level:2},{value:"Advanced Filtering",id:"advanced-filtering",level:2},{value:"Cards",id:"cards",level:2},{value:"Fetch Card with Image Reference",id:"fetch-card-with-image-reference",level:3},{value:"Include Card Images in Response",id:"include-card-images-in-response",level:3},{value:"List Cards with Images",id:"list-cards-with-images",level:3},{value:"File Uploads",id:"file-uploads",level:2},{value:"Upload Card Image",id:"upload-card-image",level:3},{value:"List Card Images",id:"list-card-images",level:3},{value:"Download Card Image",id:"download-card-image",level:3},{value:"Update Image Metadata",id:"update-image-metadata",level:3},{value:"Delete Card Image",id:"delete-card-image",level:3},{value:"Responsive Images with Versioned CDN URLs",id:"responsive-images-with-versioned-cdn-urls",level:2},{value:"Set Sources",id:"set-sources",level:2},{value:"Create Set Source",id:"create-set-source",level:3},{value:"List Sources for a Set",id:"list-sources-for-a-set",level:3},{value:"Get Set with Sources Included",id:"get-set-with-sources-included",level:3},{value:"Update Source Verification",id:"update-source-verification",level:3},{value:"Delete Set Source",id:"delete-set-source",level:3},{value:"Track Multiple Source Types",id:"track-multiple-source-types",level:3},{value:"v2 Endpoints",id:"v2-endpoints",level:2},{value:"Get Set Checklist (v2)",id:"get-set-checklist-v2",level:3},{value:"Compact Format for Large Sets",id:"compact-format-for-large-sets",level:3}];function o(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"php-examples",children:"PHP Examples"})}),"\n",(0,s.jsx)(n.p,{children:"Practical PHP snippets for querying sports card data and the wider trading card catalog through the Trading Card API."}),"\n",(0,s.jsx)(n.h2,{id:"authentication",children:"Authentication"}),"\n",(0,s.jsx)(n.h3,{id:"using-personal-access-token-recommended-for-development",children:"Using Personal Access Token (Recommended for Development)"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"<?php\n\nrequire_once 'vendor/autoload.php';\n\nuse TradingCardAPI\\Client;\n\n// Initialize with Personal Access Token\n$client = new Client([\n    'personal_access_token' => getenv('TRADING_CARD_API_PAT'),\n    'base_url' => 'https://api.tradingcardapi.com'\n]);\n\n// No additional authentication steps required!\n// The token is automatically included in all requests\n"})}),"\n",(0,s.jsx)(n.h3,{id:"using-oauth-20-client-credentials-recommended-for-production",children:"Using OAuth 2.0 Client Credentials (Recommended for Production)"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"<?php\n\nrequire_once 'vendor/autoload.php';\n\nuse TradingCardAPI\\Client;\n\n// Initialize with OAuth credentials\n$client = new Client([\n    'client_id' => getenv('TRADING_CARD_API_CLIENT_ID'),\n    'client_secret' => getenv('TRADING_CARD_API_CLIENT_SECRET'),\n    'base_url' => 'https://api.tradingcardapi.com'\n]);\n\n// Client handles OAuth token flow automatically\n"})}),"\n",(0,s.jsx)(n.h2,{id:"basic-usage",children:"Basic Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"<?php\n\nrequire_once 'vendor/autoload.php';\n\nuse TradingCardAPI\\Client;\n\n$client = new Client([\n    'client_id' => 'your_client_id',\n    'client_secret' => 'your_client_secret',\n    'base_url' => 'https://api.tradingcardapi.com'\n]);\n\n// Get cards (sports cards, gaming cards, and everything else in the catalog)\n$cards = $client->cards()->list([\n    'page[limit]' => 25,\n    'filter[year]' => 2023\n]);\n\nforeach ($cards['data'] as $card) {\n    echo $card['attributes']['name'] . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"advanced-filtering",children:"Advanced Filtering"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Search sports card data with multiple filters (1989 Ken Griffey Jr.)\n$results = $client->cards()->list([\n    'filter[year]' => 1989,\n    'filter[name]' => '*Griffey*',\n    'include' => 'set,oncard',\n    'sort' => 'name',\n    'page[limit]' => 50\n]);\n"})}),"\n",(0,s.jsx)(n.h2,{id:"cards",children:"Cards"}),"\n",(0,s.jsx)(n.h3,{id:"fetch-card-with-image-reference",children:"Fetch Card with Image Reference"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Get a card and check for image_uuid\n$cardId = '550e8400-e29b-41d4-a716-446655440000';\n\ntry {\n    $response = $client->cards()->get($cardId);\n    $card = $response['data'];\n\n    echo \"Card: \" . $card['attributes']['name'] . \"\\n\";\n    echo \"Number: \" . $card['attributes']['number'] . \"\\n\";\n\n    // Check if card has an image reference (v0.6.0+)\n    if (!empty($card['attributes']['image_uuid'])) {\n        echo \"Image UUID: \" . $card['attributes']['image_uuid'] . \"\\n\";\n    } else {\n        echo \"No image uploaded yet\\n\";\n    }\n} catch (Exception $e) {\n    echo \"Error: \" . $e->getMessage() . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"include-card-images-in-response",children:"Include Card Images in Response"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Fetch card with related images included (v0.7.0+)\n$cardId = '550e8400-e29b-41d4-a716-446655440000';\n\ntry {\n    $response = $client->cards()->get($cardId, [\n        'include' => 'images'\n    ]);\n\n    $card = $response['data'];\n    echo \"Card: \" . $card['attributes']['name'] . \"\\n\";\n\n    // Access included images\n    if (!empty($response['included'])) {\n        foreach ($response['included'] as $included) {\n            if ($included['type'] === 'card_images') {\n                echo \"Image: \" . $included['attributes']['side'] . \"\\n\";\n                echo \"URL: \" . $included['attributes']['image_url'] . \"\\n\";\n            }\n        }\n    }\n} catch (Exception $e) {\n    echo \"Error: \" . $e->getMessage() . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"list-cards-with-images",children:"List Cards with Images"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// List cards and include their images\n$results = $client->cards()->list([\n    'filter[set_id]' => '550e8400-e29b-41d4-a716-446655440000',\n    'include' => 'images,set',\n    'page[limit]' => 25\n]);\n\nforeach ($results['data'] as $card) {\n    echo $card['attributes']['number'] . \" - \" . $card['attributes']['name'];\n\n    // Check for image_uuid\n    if (!empty($card['attributes']['image_uuid'])) {\n        echo \" [Has Image]\";\n    }\n\n    echo \"\\n\";\n}\n\n// Process included images\nif (!empty($results['included'])) {\n    $images = array_filter($results['included'], function($item) {\n        return $item['type'] === 'card_images';\n    });\n\n    echo \"\\nTotal images included: \" . count($images) . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"file-uploads",children:"File Uploads"}),"\n",(0,s.jsx)(n.h3,{id:"upload-card-image",children:"Upload Card Image"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Upload a card image with validation and error handling\n$imagePath = '/path/to/card-front.jpg';\n\n// Validate file before upload\nif (!file_exists($imagePath)) {\n    throw new Exception(\"Image file not found: $imagePath\");\n}\n\n$fileSize = filesize($imagePath);\n$maxSize = 10 * 1024 * 1024; // 10MB\nif ($fileSize > $maxSize) {\n    throw new Exception(\"Image too large. Maximum size: 10MB\");\n}\n\n// Validate image type\n$mimeType = mime_content_type($imagePath);\n$allowedTypes = ['image/jpeg', 'image/png', 'image/jpg'];\nif (!in_array($mimeType, $allowedTypes)) {\n    throw new Exception(\"Invalid image type. Allowed: JPEG, PNG\");\n}\n\ntry {\n    $imageData = [\n        'type' => 'card_images',\n        'attributes' => [\n            'card_id' => '550e8400-e29b-41d4-a716-446655440000',\n            'image_type' => 'front'\n        ]\n    ];\n\n    $response = $client->cardImages()->create([\n        'file' => new \\CURLFile($imagePath, $mimeType, basename($imagePath)),\n        'data' => json_encode($imageData)\n    ]);\n\n    echo \"Image uploaded successfully!\\n\";\n    echo \"Image ID: \" . $response['data']['id'] . \"\\n\";\n    echo \"Small URL: \" . $response['data']['attributes']['variants']['small']['url'] . \"\\n\";\n    echo \"Medium URL: \" . $response['data']['attributes']['variants']['medium']['url'] . \"\\n\";\n    echo \"Large URL: \" . $response['data']['attributes']['variants']['large']['url'] . \"\\n\";\n\n    $imageId = $response['data']['id'];\n} catch (Exception $e) {\n    echo \"Upload failed: \" . $e->getMessage() . \"\\n\";\n    exit(1);\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"list-card-images",children:"List Card Images"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// List all images for a specific card\n$cardId = '550e8400-e29b-41d4-a716-446655440000';\n\n$images = $client->cardImages()->list([\n    'filter[card_id]' => $cardId\n]);\n\nforeach ($images['data'] as $image) {\n    echo \"Image ID: \" . $image['id'] . \"\\n\";\n    echo \"Type: \" . $image['attributes']['image_type'] . \"\\n\";\n    echo \"Small URL: \" . $image['attributes']['variants']['small']['url'] . \"\\n\";\n    echo \"---\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"download-card-image",children:"Download Card Image"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Download specific size variant\n$imageId = '01234567-89ab-cdef-0123-456789abcdef';\n$imageUrl = \"https://api.tradingcardapi.com/v1/card-images/{$imageId}/download?size=medium\";\n\n$ch = curl_init($imageUrl);
1\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow CDN redirects\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n    'Authorization: Bearer ' . $client->getAccessToken()\n]);\n\n$imageData = curl_exec($ch);\n$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\ncurl_close($ch);\n\nif ($httpCode === 200 && $imageData) {\n    file_put_contents('card-image.jpg', $imageData);\n    echo \"Image downloaded successfully\\n\";\n} else {\n    echo \"Download failed with HTTP code: $httpCode\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"update-image-metadata",children:"Update Image Metadata"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Update image metadata (e.g., change from front to back)\n$imageId = '01234567-89ab-cdef-0123-456789abcdef';\n\ntry {\n    $response = $client->cardImages()->update($imageId, [\n        'type' => 'card_images',\n        'id' => $imageId,\n        'attributes' => [\n            'image_type' => 'back'\n        ]\n    ]);\n\n    echo \"Image metadata updated successfully\\n\";\n    echo \"New type: \" . $response['data']['attributes']['image_type'] . \"\\n\";\n} catch (Exception $e) {\n    echo \"Update failed: \" . $e->getMessage() . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"delete-card-image",children:"Delete Card Image"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:'// Delete a card image\n$imageId = \'01234567-89ab-cdef-0123-456789abcdef\';\n\ntry {\n    $client->cardImages()->delete($imageId);\n    echo "Image deleted successfully\\n";\n} catch (Exception $e) {\n    echo "Deletion failed: " . $e->getMessage() . "\\n";\n}\n'})}),"\n",(0,s.jsx)(n.h2,{id:"responsive-images-with-versioned-cdn-urls",children:"Responsive Images with Versioned CDN URLs"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Fetch image with versioned CDN URLs\n$imageResponse = $client->cardImages()->get($imageId);\n$attrs = $imageResponse['data']['attributes'];\n\n// All URLs include version parameter (?v=timestamp) for automatic cache invalidation\n$smallUrl = $attrs['variants']['small']['url'];\n$mediumUrl = $attrs['variants']['medium']['url'];\n$largeUrl = $attrs['variants']['large']['url'];\n\n// Generate responsive image markup\necho '<img\n    src=\"' . htmlspecialchars($smallUrl) . '\"\n    srcset=\"\n        ' . htmlspecialchars($smallUrl) . ' 150w,\n        ' . htmlspecialchars($mediumUrl) . ' 300w,\n        ' . htmlspecialchars($largeUrl) . ' 600w\n    \"\n    sizes=\"(max-width: 640px) 150px, 300px\"\n    alt=\"Card image\"\n    loading=\"lazy\"\n/>';\n\n// Or create a reusable function\nfunction generateResponsiveCardImage($client, $imageId, $cardName) {\n    $image = $client->cardImages()->get($imageId);\n    $attrs = $image['data']['attributes'];\n\n    return sprintf(\n        '<img src=\"%s\" srcset=\"%s 150w, %s 300w, %s 600w\" ' .\n        'sizes=\"(max-width: 640px) 150px, 300px\" alt=\"%s\" loading=\"lazy\" />',\n        htmlspecialchars($attrs['variants']['small']['url']),\n        htmlspecialchars($attrs['variants']['small']['url']),\n        htmlspecialchars($attrs['variants']['medium']['url']),\n        htmlspecialchars($attrs['variants']['large']['url']),\n        htmlspecialchars($cardName)\n    );\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"set-sources",children:"Set Sources"}),"\n",(0,s.jsx)(n.h3,{id:"create-set-source",children:"Create Set Source"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Add a checklist source to a set\n$setId = '550e8400-e29b-41d4-a716-446655440000';\n\ntry {\n    $sourceData = [\n        'type' => 'set_sources',\n        'attributes' => [\n            'set_id' => $setId,\n            'source_type' => 'checklist',\n            'source_name' => 'Beckett Online Price Guide',\n            'source_url' => 'https://www.beckett.com/price-guides'\n        ]\n    ];\n\n    $response = $client->setSources()->create($sourceData);\n\n    echo \"Source created successfully!\\n\";\n    echo \"Source ID: \" . $response['data']['id'] . \"\\n\";\n    echo \"Type: \" . $response['data']['attributes']['source_type'] . \"\\n\";\n    echo \"Name: \" . $response['data']['attributes']['source_name'] . \"\\n\";\n} catch (Exception $e) {\n    echo \"Failed to create source: \" . $e->getMessage() . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"list-sources-for-a-set",children:"List Sources for a Set"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Get all sources for a specific set\n$setId = '550e8400-e29b-41d4-a716-446655440000';\n\n$sources = $client->setSources()->list([\n    'filter[set_id]' => $setId\n]);
1\n\necho \"Found \" . count($sources['data']) . \" sources\\n\\n\";\n\nforeach ($sources['data'] as $source) {\n    echo \"Source Type: \" . $source['attributes']['source_type'] . \"\\n\";\n    echo \"Name: \" . $source['attributes']['source_name'] . \"\\n\";\n    echo \"URL: \" . $source['attributes']['source_url'] . \"\\n\";\n\n    if (isset($source['attributes']['verified_at'])) {\n        echo \"Verified: \" . $source['attributes']['verified_at'] . \"\\n\";\n    }\n    echo \"---\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"get-set-with-sources-included",children:"Get Set with Sources Included"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Fetch a set with all its sources using include parameter\n$setId = '550e8400-e29b-41d4-a716-446655440000';\n\n$response = $client->sets()->get($setId, [\n    'include' => 'sources'\n]);\n\n$set = $response['data'];\necho \"Set: \" . $set['attributes']['name'] . \"\\n\";\necho \"Cards: \" . $set['attributes']['card_count'] . \"\\n\\n\";\n// Release year is a relationship, not an attribute \u2014 add 'year' to the\n// include list and read it off the included 'years' resource.\n\n// Sources are in the included array\nif (isset($response['included'])) {\n    echo \"Data Sources:\\n\";\n    foreach ($response['included'] as $included) {\n        if ($included['type'] === 'set_sources') {\n            echo \"- \" . $included['attributes']['source_type'] . \": \";\n            echo $included['attributes']['source_name'] . \"\\n\";\n        }\n    }\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"update-source-verification",children:"Update Source Verification"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Update a source to mark it as verified\n$sourceId = '01234567-89ab-cdef-0123-456789abcdef';\n\ntry {\n    $response = $client->setSources()->update($sourceId, [\n        'type' => 'set_sources',\n        'id' => $sourceId,\n        'attributes' => [\n            'verified_at' => date('c') // ISO 8601 format\n        ]\n    ]);\n\n    echo \"Source verified at: \" . $response['data']['attributes']['verified_at'] . \"\\n\";\n} catch (Exception $e) {\n    echo \"Verification failed: \" . $e->getMessage() . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"delete-set-source",children:"Delete Set Source"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:'// Remove a source from a set\n$sourceId = \'01234567-89ab-cdef-0123-456789abcdef\';\n\ntry {\n    $client->setSources()->delete($sourceId);\n    echo "Source deleted successfully\\n";\n} catch (Exception $e) {\n    echo "Deletion failed: " . $e->getMessage() . "\\n";\n}\n'})}),"\n",(0,s.jsx)(n.h3,{id:"track-multiple-source-types",children:"Track Multiple Source Types"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Add multiple sources for different data types\n$setId = '550e8400-e29b-41d4-a716-446655440000';\n\n$sourceTypes = [\n    [\n        'type' => 'checklist',\n        'name' => 'COMC Database',\n        'url' => 'https://www.comc.com'\n    ],\n    [\n        'type' => 'metadata',\n        'name' => 'CardboardConnection',\n        'url' => 'https://www.cardboardconnection.com'\n    ],\n    [\n        'type' => 'images',\n        'name' => 'Trading Card Database',\n        'url' => 'https://www.tradingcarddb.com'\n    ]\n];\n\nforeach ($sourceTypes as $sourceInfo) {\n    try {\n        $response = $client->setSources()->create([\n            'type' => 'set_sources',\n            'attributes' => [\n                'set_id' => $setId,\n                'source_type' => $sourceInfo['type'],\n                'source_name' => $sourceInfo['name'],\n                'source_url' => $sourceInfo['url']\n            ]\n        ]);\n\n        echo \"Added \" . $sourceInfo['type'] . \" source: \" . $sourceInfo['name'] . \"\\n\";\n    } catch (Exception $e) {\n        echo \"Failed to add \" . $sourceInfo['type'] . \" source: \" . $e->getMessage() . \"\\n\";\n    }\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"v2-endpoints",children:"v2 Endpoints"}),"\n",(0,s.jsx)(n.h3,{id:"get-set-checklist-v2",children:"Get Set Checklist (v2)"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// v2 endpoint returns cards as primary data (correct JSON:API semantics)\n$setId = '550e8400-e29b-41d4-a716-446655440000';\n\ntry {\n    $response = $client->get(\"/v2/sets/{$setId}/checklist\");\n    $cards = $response['data'];\n    $set = $response['included'][0] ?? null;\n\n    foreach ($cards as $card) {\n        echo \"Card #{$card['attributes']['number']}: {$card['attributes']['name']}\\n\";\n    }\n} catch (Exception $e) {\n    echo \"Error: \" . $e->getMessage() . \"\\n\";\n}\n"})}),"\n",(0,s.jsx)(n.h3,{id:"compact-format-for-large-sets",children:"Compact Format for Large Sets"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-php",children:"// Use compact format to reduce response size by ~75%\n$setId = '550e8400-e29b-41d4-a716-446655440000';\n\ntry {\n    $response = $client->get(\"/v2/sets/{$setId}/checklist\", [\n        'format' => 'compact'\n    ]);\n\n    foreach ($response['data'] as $card) {\n        $attrs = $card['attributes'];\n        printf(\"#%-4s %s\\n\", $attrs['number'], $attrs['name']);\n    }\n} catch (Exception $e) {\n    echo \"Error: \" . $e->getMessage() . \"\\n\";\n}\n"})})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(o,{...e})}):o(e)}},8453(e,n,a){a.d(n,{R:()=>i,x:()=>c});var t=a(6540);const s={},r=t.createContext(s);function i(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.