I am working on a script to handle a search query. In some instances,
the query could come through as "isbn:%20###### #######" (where %20 is
an encoded space and the colon is optional). Basically I want to
strip off the ISBN portion and leave just the numbers if that is the
case.
Orignally I was trying
$value = $_GET["query"];
if (preg_match("is bn:?%20", $value))
{
$isbn = preg_replace("i sbn:?%20", "", $value)
}
else
{
$isbn = $value
}
Doesn't seem to work though. Any thoughts?
the query could come through as "isbn:%20###### #######" (where %20 is
an encoded space and the colon is optional). Basically I want to
strip off the ISBN portion and leave just the numbers if that is the
case.
Orignally I was trying
$value = $_GET["query"];
if (preg_match("is bn:?%20", $value))
{
$isbn = preg_replace("i sbn:?%20", "", $value)
}
else
{
$isbn = $value
}
Doesn't seem to work though. Any thoughts?
Comment