php解析go语言包,使用PHP解析智能搜索

I'm building a UI using PHP and jquery that will allow someone to type in a string and it will search apt search

What i want to do is separate (using php) the packaga name, the architecture just after the / and the description of the package just below the line of the package and architecture so i can push this data into a JSON collection and return it to jQuery.

我正在执行以下命令:

$data=shell_exec("sudo apt search $searchString")

I can get the package name and the architecture using explosion on / but dont know how to get the line below

Here's an example output of this search against php:

wwwconfig-common/bionic 0.3.0 all

Debian web auto configuration

xine-ui/bionic 0.99.9-1.3 amd64

the xine video player, user interface

xjed/bionic 1:0.99.19-7 amd64

editor for programmers (x11 version)

xmlsysd/bionic 2.6.0-0ubuntu4 amd64

wulfware daemon to extract data from cluster nodes

yasat/bionic 848-1ubuntu1 all

simple stupid audit tool

yhsm-validation-server/bionic 1.2.0-1 all

Validation server using YubiHSM

yrmcds/bionic 1.1.8-1.1 amd64

memcached compatible KVS with master/slave replication

yubikey-server-c/bionic 0.5-1build3 amd64

Yubikey validation server

yubikey-val/bionic 2.38-2 all

One-Time Password (OTP) validation server for YubiKey tokens

zabbix-frontend-php/bionic 1:3.0.12+dfsg-1 all

network monitoring solution - PHP front-end

zendframework/bionic 1.12.20+dfsg-1ubuntu1 all

powerful PHP framework

zendframework-bin/bionic 1.12.20+dfsg-1ubuntu1 all

binary scripts for zendframework

感谢您的协助!

更新:

我可以使用爆炸的“ /”来获取包名称和体系结构,但是我不知道如何获取下面的行。以为我可以找到一个不错的解决方案

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值