Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
The PHP Workshop

You're reading from   The PHP Workshop Learn to build interactive applications and kickstart your career as a web developer

Arrow left icon
Product type Paperback
Published in Oct 2019
Publisher Packt
ISBN-13 9781838648916
Length 604 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (8):
Arrow left icon
 Martinez Martinez
Author Profile Icon Martinez
Martinez
 Busuioc Busuioc
Author Profile Icon Busuioc
Busuioc
 Carr Carr
Author Profile Icon Carr
Carr
 Gray Gray
Author Profile Icon Gray
Gray
 Joshi Joshi
Author Profile Icon Joshi
Joshi
 McCollum McCollum
Author Profile Icon McCollum
McCollum
 McLeod McLeod
Author Profile Icon McLeod
McLeod
 Tonu Tonu
Author Profile Icon Tonu
Tonu
+4 more Show less
Arrow right icon
View More author details
Toc

Query Strings

A query string is part of a URL, containing data described in key-value pairs. Each key-value pair is delimited by the ampersand character (&), while the delimiter of a URL path from its query string is a question mark (?).

As an example, we'll use the following fictive URL:

https://www.bookstore.com/books/?category=Comics&page=2.

Here, the query string is category=Comics&page=2 and the parameters are category and page with Comics and 2 values, respectively. It is worth noting that the parameters that can hold data are then parsed as arrays of values. For example, given the /filter?tags[]=comics&tags[]=recent URI, the tags query string parameter will result in an array with two values – comics and recent.

Query strings are mostly used to access resources on the server, rather than as instructions to create, update, or delete. So, sharing a URL with a query string would list the same results in any browser, when no other contexts...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime