0

I am developing an accounting software as project. I want to count sets of variables in URL query string. eg

http://localhost/xampp/khata2/test/tableaddrow_nw.php?accname1=1&DrAmount1=1&CrAmount1=1&accname2=2+was2&DrAmount2=2&CrAmount2=2&accname3=3+was3&DrAmount3=3&CrAmount3=3&accname4=4+was4&DrAmount4=4&CrAmount4=4&accname5=5+was5&DrAmount5=5&CrAmount5=5&accname6=6+was6&DrAmount6=6&CrAmount6=6

There is a set of kind of rows in a query string accname1,DrAmount1,CrAmount1 .... accname6,DrAmount6,CrAmount6 so on which is generated dynamicaly as user inputs data in rows. how can i find out ho many rows are (set of data) are in query string ?

Any help is appreciated.

1 Answer 1

1
$rows = explode("&", $_SERVER['QUERY_STRING']);

This will give you an array of:

accname1=1
DrAmount1=1
CrAmount1=1

So you could get the total as count($rows).

Is this what you meant?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.