Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

FarhadMohammadi's avatar

PHP Regex For extract query where params?

I have some input as filters for index api like status=1 or age>=23 and etc. I want to extract condition params by preg_match with regex. the result must be like below:

['field' => 'status' ,'operator' => '=', 'value' => 1]

which regex is suitable for?

0 likes
8 replies
Tray2's avatar

@kishan_jethava Please don't highjack other threads. Open your own and describe what it is you want to do and what you have done so far.

Any code should be wrapped in three back ticks. `

function something()
{
	//Code
}
1 like
kokoshneta's avatar

@kishan_jethava STOP HIJACKING OTHER PEOPLE’S QUESTIONS

Ask your own question. No one will answer you here. You’ve been told this five times now.

kokoshneta's avatar

@FarhadMohammadi Sorry, that wasn’t directed at you. This thread is for your question, but someone else kept asking a completely different question again and again in it, trying to hijack it. They’ve now deleted at least some of their posts (including the one I was replying to), presumably to ask in their own thread.

1 like

Please or to participate in this conversation.