php string to array and split
Posted
by RussP
on Stack Overflow
See other posts from Stack Overflow
or by RussP
Published on 2010-05-08T11:47:01Z
Indexed on
2010/05/08
11:58 UTC
Read the original article
Hit count: 163
php
|string-manipulation
Hi folks
Looking for suggestions as to the best way to do this (I know there are many options):
take a variable like this:
$args = ('post_type=post&order_by=DESC&limit=10');
the create a function to convert that variable into parts like this:
$post_type = post;
$order_by = DESC;
$limit= 10;
Reason is I want a client to be able to use a string like the first to pass variables to a sql query in much the same way (but doesn't have to be exact) as you can do it in WordPress.
© Stack Overflow or respective owner