{"id":17680757,"url":"https://github.com/kcreate/ptf","last_synced_at":"2025-06-19T16:40:37.008Z","repository":{"id":72283036,"uuid":"42189428","full_name":"KCreate/PTF","owner":"KCreate","description":"PHP Tag Formatting (or short PTF)","archived":false,"fork":false,"pushed_at":"2015-09-09T19:46:23.000Z","size":172,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T18:09:14.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KCreate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-09T16:07:44.000Z","updated_at":"2016-10-31T07:25:21.000Z","dependencies_parsed_at":"2023-03-02T11:30:57.930Z","dependency_job_id":null,"html_url":"https://github.com/KCreate/PTF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KCreate/PTF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2FPTF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2FPTF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2FPTF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2FPTF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KCreate","download_url":"https://codeload.github.com/KCreate/PTF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KCreate%2FPTF/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260789682,"owners_count":23063612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T09:08:46.414Z","updated_at":"2025-06-19T16:40:31.998Z","avatar_url":"https://github.com/KCreate.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PTF\n* Stands for PHP-Tag-Formatting\n* Easily implementable\n* Fast (i guess?)\n* See an example here: http://leonardschuetz.ch/projects/PTF/source.php\n\n## Installation\nInstallation is actually pretty easy. Just download the ls_ptf.php file and include it into your project.\n\n## Usage and pre-supported tags\nTo format all the tags inside a string just write:\n```\n$a = \"Click this #a#http://awesomesite.com - link#a#\";\n$b = parse($a);\n// $b will be \"Click this \u003ca href=\"http://awesomesite.com\"\u003elink\u003c/a\u003e\"\n```\n### `#a#`\n```\n#a#url - title#a#\t// regular notation.\n#a#url#a#\t\t\t// short notation, title will always be Link unless changed.\n```\n\n### `#img#`\n```\n#img#url#img#\t\t// regular notation.\n```\n\n### `#hl#`\n```\n#hl#some text#hl#\t// regular notation, puts wrapped text in a \u003cspan\u003e element with a class called \"highlight\".\n```\n\n### `#h#`\n```\n#h#title#h#\t\t\t// regular notation, puts wrapped text in a \u003ch1\u003e element.\n```\n\n### `#qo#`\n```\n#qo#awesome cite ~ Leonard Schuetz#qo# // regular notation, puts wrapped text in a \u003cblockquote\u003e element.\n```\n\n## Customization\nChange the definitions in the parse() function to choose which, and how the tags are being outputted.\nFor example if you want #github#PTF#github# to result in this: `\u003cspan class=\"github\"\u003ePTF\u003c/span\u003e`\nYou'd write:\n```\nif (str_contains('#github#', $value)) {\n\t$value = parseTag('#github#', $value, \"\u003cspan class=\"github\"\u003e\", '\u003c/span\u003e');\n}\n```\n#### Parameters:\n* Tag\n* String\n* What to replace the opening tag with\n* What to replace the closing tag with\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcreate%2Fptf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcreate%2Fptf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcreate%2Fptf/lists"}