{"id":18486109,"url":"https://github.com/mathsgod/p-query","last_synced_at":"2026-02-17T02:06:32.702Z","repository":{"id":62525022,"uuid":"164818980","full_name":"mathsgod/p-query","owner":"mathsgod","description":"Using jquery like method to parse html by using php","archived":false,"fork":false,"pushed_at":"2025-02-12T10:34:10.000Z","size":293,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T21:03:48.602Z","etag":null,"topics":["dom","html","php","php-library"],"latest_commit_sha":null,"homepage":"","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/mathsgod.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-09T08:15:20.000Z","updated_at":"2025-02-12T10:34:15.000Z","dependencies_parsed_at":"2024-11-06T12:52:05.667Z","dependency_job_id":null,"html_url":"https://github.com/mathsgod/p-query","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fp-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fp-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fp-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fp-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/p-query/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fp-query/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178485,"owners_count":22817386,"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":["dom","html","php","php-library"],"created_at":"2024-11-06T12:47:53.403Z","updated_at":"2026-02-17T02:06:32.675Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![LICENSE](https://img.shields.io/github/license/mathsgod/p-query)\n\n![PHP Composer](https://github.com/mathsgod/p-query/workflows/PHP%20Composer/badge.svg)\n\n\n## Introduction\nPQuery is a PHP library used to control html string by using jQuery liked method.\n\n\n## Example\n```php\nrequire_once(\"vendor/autoload.php\");\n\n$p = p('\u003cdiv class=\"container\"\u003e\n    \u003cdiv class=\"hello\"\u003eHello\u003c/div\u003e\n\u003c/div\u003e');\n\n$p-\u003efind(\".hello\")-\u003etext(\"abc\");\n\necho $p; /*output \n\u003cdiv class=\"container\"\u003e\n    \u003cdiv class=\"hello\"\u003eabc\u003c/div\u003e\n\u003c/div\u003e\n*/\n```\n\n## PQuery supported method\n- size\n- last\n- first\n- html\n- prepend\n- prependTo\n- appendTo\n- append\n- attr\n- after\n- before\n- css\n- closest\n- data\n- addClass\n- text\n- contents\n- children\n- find\n- remove\n- removeAtt\n- removeClass\n- replaceWith\n- required\n- each\n- val\n- filter\n- parent\n- warp\n- warpInner\n- toggleClass\n- hasClass\n- prev\n- next\n- index\n\n\n## HTML element style and class\n```php\n$div = new HTMLDivElement();\n$div-\u003eclassList-\u003eadd(\"container\");\n$div-\u003einnerText = \"Hello world!\";\n$div-\u003estyle-\u003ecolor = \"red\";\n\necho $div; //\u003cdiv class=\"container\" style=\"color: red\"\u003eHello world!\u003c/div\u003e\n```\n\n## Element.append\n\n### Append an element\n```php\n$div=new HTMLDivElement();\n$p=new HTMLParagraphElement();\n$div-\u003eappend($p);\n\necho $div; // \u003cdiv\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e\n```\n\n### Appending text\n```php\n$div=new HTMLDivElement();\n$div-\u003eappend(\"Some text\");\n\necho $div; // \u003cdiv\u003eSome text\u003c/div\u003e\n```\n\n### Appending an element and text\n```php\n$div=new HTMLDivElement();\n$p=new HTMLParagraphElement();\n$div-\u003eappend(\"Some text\",$p);\n\necho $div; // \u003cdiv\u003eSome text\u003cp\u003e\u003c/p\u003e\u003c/div\u003e\n```\n___\ncreated by Raymond Chong\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fp-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Fp-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fp-query/lists"}