php - 如何用php从这个字符串中回显数据
问题描述
我想从下面的字符串中提取我想要的项目我 要用 PHP 来做这件事 有人能帮我吗?
我的字符串:
google.search.cse.api7456({
"cursor": {
"currentPageIndex": 0,
"estimatedResultCount": "2570000000",
"moreResultsUrl": "http://www.google.com/",
"resultCount": "2,570,000,000",
"searchResultTime": "0.36",
"pages": [
{
"label": 1,
"start": "0"
},
{
"label": 2,
"start": "20"
},
{
"label": 3,
"start": "40"
},
{
"label": 4,
"start": "60"
},
{
"label": 5,
"start": "80"
}
]
},
"context": {
"title": "Web Search",
"total_results": "0"
},
"results": [
{
"cacheUrl": "http://www.google.com/search?q=cache:ZQh_B4K4VhQJ:www.php.net",
"clicktrackUrl": "https://www.google.com/url?client=internal-element-cse&cx=partner-pub-9134522736300956:4140494421&q=https://www.php.net/manual/en/book.phar.php&sa=U&ved=2ahUKEwitgb3goN3vAhXS8LsIHedyCqwQFjAAegQIARAB&usg=AOvVaw18842X_9SqFEhhaIwQBHac",
"content": "... Convert a phar \u003cb\u003earchive\u003c/b\u003e to a non-executable tar or zip file; Phar::\nconvertToExecutable — Convert a phar \u003cb\u003earchive\u003c/b\u003e to another executable phar \n\u003cb\u003earchive\u003c/b\u003e file format ...",
"contentNoFormatting": "... Convert a phar archive to a non-executable tar or zip file; Phar::\nconvertToExecutable — Convert a phar archive to another executable phar \narchive file format ...",
"title": "Phar - Manual - PHP",
"titleNoFormatting": "Phar - Manual - PHP",
"formattedUrl": "https://www.\u003cb\u003ephp\u003c/b\u003e.net/manual/en/book.phar.\u003cb\u003ephp\u003c/b\u003e",
"unescapedUrl": "https://www.php.net/manual/en/book.phar.php",
"url": "https://www.php.net/manual/en/book.phar.php",
"visibleUrl": "www.php.net",
"richSnippet": {
"metatags": {
"viewport": "width=device-width, initial-scale=1.0"
}
},
"breadcrumbUrl": {
"host": "www.php.net",
"crumbs": [
"manual",
"book.phar.php"
]
}
},
{
"cacheUrl": "http://www.google.com/search?q=cache:oF_HUyG3J8MJ:en.wikipedia.org",
"clicktrackUrl": "https://www.google.com/url?client=internal-element-cse&cx=partner-pub-9134522736300956:4140494421&q=https://en.wikipedia.org/wiki/PHAR_(file_format)&sa=U&ved=2ahUKEwitgb3goN3vAhXS8LsIHedyCqwQFjABegQIExAB&usg=AOvVaw1B9f4N1kCv5G2jqhX6GEId",
"content": "In software, a PHAR (\u003cb\u003ePHP Archive\u003c/b\u003e) file is a package format to enable distribution \nof applications and libraries by bundling many PHP code files and other ...",
"contentNoFormatting": "In software, a PHAR (PHP Archive) file is a package format to enable distribution \nof applications and libraries by bundling many PHP code files and other ...",
"title": "PHAR (file format) - Wikipedia",
"titleNoFormatting": "PHAR (file format) - Wikipedia",
"formattedUrl": "https://en.wikipedia.org/wiki/PHAR_(file_format)",
"unescapedUrl": "https://en.wikipedia.org/wiki/PHAR_(file_format)",
"url": "https://en.wikipedia.org/wiki/PHAR_(file_format)",
"visibleUrl": "en.wikipedia.org",
"richSnippet": {
"metatags": {
"referrer": "origin",
"ogTitle": "PHAR (file format) - Wikipedia",
"ogType": "website"
}
},
"breadcrumbUrl": {
"host": "en.wikipedia.org",
"crumbs": [
"wiki",
"PHAR_(file_format)"
]
}
},
{
"cacheUrl": "http://www.google.com/search?q=cache:R7KjRoykITgJ:www.php.net",
"clicktrackUrl": "https://www.google.com/url?client=internal-element-cse&cx=partner-pub-9134522736300956:4140494421&q=https://www.php.net/manual/en/phar.using.intro.php&sa=U&ved=2ahUKEwitgb3goN3vAhXS8LsIHedyCqwQFjACegQIERAB&usg=AOvVaw15HS5ORidOHOyYH5D4cQyj",
"content": "The phar stream wrapper allows accessing the files within a phar \u003cb\u003earchive\u003c/b\u003e using \n\u003cb\u003ePHP's\u003c/b\u003e standard file functions fopen(), opendir(), and others that work on regular ...",
"contentNoFormatting": "The phar stream wrapper allows accessing the files within a phar archive using \nPHP's standard file functions fopen(), opendir(), and others that work on regular ...",
"title": "Using Phar Archives: Introduction - Manual - PHP",
"titleNoFormatting": "Using Phar Archives: Introduction - Manual - PHP",
"formattedUrl": "https://www.\u003cb\u003ephp\u003c/b\u003e.net/manual/en/phar.using.intro.\u003cb\u003ephp\u003c/b\u003e",
"unescapedUrl": "https://www.php.net/manual/en/phar.using.intro.php",
"url": "https://www.php.net/manual/en/phar.using.intro.php",
"visibleUrl": "www.php.net",
"richSnippet": {
"metatags": {
"viewport": "width=device-width, initial-scale=1.0"
}
},
"breadcrumbUrl": {
"host": "www.php.net",
"crumbs": [
"manual",
"phar.using.intro.php"
]
}
},
{
"cacheUrl": "http://www.google.com/search?q=cache:hdLqmA5_Q9IJ:medium.com",
"clicktrackUrl": "https://www.google.com/url?client=internal-element-cse&cx=partner-pub-9134522736300956:4140494421&q=https://medium.com/%40tfidry/create-and-deploy-secure-phars-c5572f10b4dd&sa=U&ved=2ahUKEwitgb3goN3vAhXS8LsIHedyCqwQFjAKegQIDBAC&usg=AOvVaw2pE_8uCbFfU5efIQFphwKt",
"content": "29 Dec 2017 \u003cb\u003e...\u003c/b\u003e For those who are not familiar with it, PHAR (\u003cb\u003ePhp Archive\u003c/b\u003e) is analogous to the \nJAR file concept but for PHP. It allows you to package an ...",
"contentNoFormatting": "29 Dec 2017 ... For those who are not familiar with it, PHAR (Php Archive) is analogous to the \nJAR file concept but for PHP. It allows you to package an ...",
"title": "Create and deploy secure PHARs. For those who are not familiar ...",
"titleNoFormatting": "Create and deploy secure PHARs. For those who are not familiar ...",
"formattedUrl": "https://medium.com/@tfidry/create-and-deploy-secure-phars-c5572f10b4dd",
"unescapedUrl": "https://medium.com/@tfidry/create-and-deploy-secure-phars-c5572f10b4dd",
"url": "https://medium.com/%40tfidry/create-and-deploy-secure-phars-c5572f10b4dd",
"visibleUrl": "medium.com",
"richSnippet": {
"cseImage": {
"src": "https://miro.medium.com/max/414/1*hhQG6DX59IjMIhyPCmCT4w.png",
"width": "229",
"type": "1",
"height": "220"
},
"metatags": {
"twitterAppUrlIphone": "medium://p/c5572f10b4dd",
"twitterTitle": "Create and deploy secure PHARs",
"ogTitle": "Create and deploy secure PHARs",
"alAndroidPackage": "com.medium.reader",
"title": "Create and deploy secure PHARs. For those who are not familiar with it… | by Théo Fidry | Medium",
"twitterLabel1": "Reading time",
"ogType": "article",
"twitterCard": "summary_large_image",
"twitterData1": "8 min read",
"alAndroidAppName": "Medium",
"ogSiteName": "Medium",
"twitterAppNameIphone": "Medium",
"twitterSite": "@Medium",
"alWebUrl": "https://medium.com/@tfidry/create-and-deploy-secure-phars-c5572f10b4dd",
"articlePublishedTime": "2018-05-31T12:58:30.871Z",
"parselyPostId": "c5572f10b4dd",
"author": "Théo Fidry",
"alIosAppStoreId": "828256236",
"ogDescription": "For those who are not familiar with it, PHAR (Php Archive) is analogous to the JAR file concept but for PHP. It allows you to package an…",
"ogImage": "https://miro.medium.com/max/414/1*hhQG6DX59IjMIhyPCmCT4w.png",
"twitterImageSrc": "https://miro.medium.com/max/414/1*hhQG6DX59IjMIhyPCmCT4w.png",
"referrer": "unsafe-url",
"viewport": "width=device-width,minimum-scale=1,initial-scale=1",
"themeColor": "#000000",
"twitterDescription": "For those who are not familiar with it, PHAR (Php Archive) is analogous to the JAR file concept but for PHP. It allows you to package an…",
"alIosAppName": "Medium",
"alIosUrl": "medium://p/c5572f10b4dd",
"ogUrl": "https://medium.com/@tfidry/create-and-deploy-secure-phars-c5572f10b4dd",
"twitterAppIdIphone": "828256236",
"fbAppId": "542599432471018",
"alAndroidUrl": "medium://p/c5572f10b4dd",
"articleAuthor": "https://medium.com/@tfidry"
}
},
"breadcrumbUrl": {
"host": "medium.com",
"crumbs": [
"..."
]
}
},
{
"cacheUrl": "http://www.google.com/search?q=cache:ANsd0gn_CG8J:matomo.org",
"clicktrackUrl": "https://www.google.com/url?client=internal-element-cse&cx=partner-pub-9134522736300956:4140494421&q=https://matomo.org/docs/setup-auto-archiving/&sa=U&ved=2ahUKEwitgb3goN3vAhXS8LsIHedyCqwQFjATegQIAhAB&usg=AOvVaw0nBYqpGgl4e-rA7nyxCCRr",
"content": "You can execute the command “which \u003cb\u003ephp\u003c/b\u003e” or “which \u003cb\u003ephp\u003c/b\u003e” in a linux shell, to find \nout the the path of your \u003cb\u003ePHP\u003c/b\u003e ...",
"contentNoFormatting": "You can execute the command “which php” or “which php” in a linux shell, to find \nout the the path of your PHP ...",
"title": "How to Set up Auto-\u003cb\u003eArchiving\u003c/b\u003e of Your Reports User Guide - Analytics ...",
"titleNoFormatting": "How to Set up Auto-Archiving of Your Reports User Guide - Analytics ...",
"formattedUrl": "https://matomo.org/docs/setup-auto-\u003cb\u003earchiving\u003c/b\u003e/",
"unescapedUrl": "https://matomo.org/docs/setup-auto-archiving/",
"url": "https://matomo.org/docs/setup-auto-archiving/",
"visibleUrl": "matomo.org",
"richSnippet": {
"cseImage": {
"src": "https://static.matomo.org/wp-content/uploads/2018/11/feature.png",
"width": "321",
"type": "1",
"height": "157"
},
"metatags": {
"twitterSite": "@matomo_org",
"ogImageWidth": "1024",
"ogTitle": "How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo",
"twitterLabel1": "Est. reading time",
"ogLocale": "en_US",
"ogImage": "https://static.matomo.org/wp-content/uploads/2018/11/feature.png",
"ogType": "article",
"articlePublisher": "https://www.facebook.com/Matomo.org",
"twitterCard": "summary",
"msapplicationTileimage": "https://static.matomo.org/wp-content/uploads/2018/11/cropped-DefaultIcon-270x270.png",
"ogImageHeight": "500",
"twitterData1": "14 minutes",
"viewport": "width=device-width, initial-scale=1",
"ogUrl": "https://matomo.org/docs/setup-auto-archiving/",
"ogSiteName": "Analytics Platform - Matomo",
"articleModifiedTime": "2021-03-24T02:22:11+00:00"
}
},
"breadcrumbUrl": {
"host": "matomo.org",
"crumbs": [
"User guides",
"Configuration"
]
}
}
],
"findMoreOnGoogle": {
"url": "https://www.sc.com/"
}
});
解决方案
推荐阅读
- github - README.md 中的 GitHub 列表
- python - 如何修补同一对象的多个方法
- mysql - SELECT 列表不在 GROUP BY 子句中并且包含非聚合列;这与 sql_mode=only_full_group_by 不兼容
- android - 将 BottomNavigationView 放在 CoordinatorLayout 中的 Layout 下方
- swift - 拍照允许我在 BSImagePicker Swift ios 中选择超过 maxNumberOfSelections
- html - 如何设置Angular 6 mat-tabs的样式?
- python - 迭代地创建带有变量变化的 bash shell 脚本(在 Python 中?)
- c# - 在数据库中存储包含列表<>的自定义对象
- php - php在实例化类中设置变量值
- asp.net-core - Microsoft/dotnet 中没有 rsync 命令:最新图像