How to split a string by multiple delimiters in PHP?

|
Mayank_theDevloper 2020-08-06 19:52:54
hi @S23G28 I think you are looking for this
https://stackoverflow.com/questions/1452777/how-to-split-a-string-by-multiple-delimiters-in-php

maybe its helpful for you please check link

How to split a string by multiple delimiters in PHP?Stack Overflow
“something here ; and there, oh,that’s all!”

I want to split it by ; and ,

so after processing should get:

something here

and there

oh

that’s all!

Goelkartik62 2020-08-06 19:58:16
Let me check it.
Goelkartik62 2020-08-06 19:58:17
Wait
Goelkartik62 2020-08-06 20:08:47
$string = “key=7,age=23”;

$array = explode(‘,’,$string);

$result = array();

foreach($array as $value){
$data = explode(‘=’,$value);
array_push($result,$data[0],$data[1]);
}

echo ‘<pre>’;
print_r($result);

Goelkartik62 2020-08-06 20:09:06
Please check this code… may be it is useful for you..
Goelkartik62 2020-08-06 20:10:38
luv_php-22179.jpg

rohit267 2020-08-06 20:29:21
next time better use json instead of this type of strings
rohit267 2020-08-06 20:49:43
ask the owner to change it to a json array
2020-08-06 23:20:45
luv_php-22191.jpg
how to insert data into database using multiselect checkbox with multiples rows
😎 2020-08-07 07:53:18
Thank you rose
😎 2020-08-07 07:58:31
I have a problem in angularjs
😎 2020-08-07 08:01:45
luv_php-22196.jpg
When I click item view button it show related data particular person
😎 2020-08-07 08:07:37
luv_php-22199.jpg
This data show which companie’s item sold particular persons
😎 2020-08-07 08:07:37
luv_php-22198.jpg
This data show related person how many item sold particular person . Common I’d is here β€œpid”
😎 2020-08-07 08:07:37
luv_php-22197.jpg
This data show in screen above pic
😎 2020-08-07 08:07:53
Data base πŸ‘†πŸ»
😎 2020-08-07 08:13:23
luv_php-22203.jpg
After controller this is my sql file where data fetch from dB
😎 2020-08-07 08:13:23
luv_php-22202.jpg
This is controller 1 one function for load data of profile of person and second one show data particular person item sold but I confused
😎 2020-08-07 08:13:23
luv_php-22201.jpg
Item view button here
😎 2020-08-07 08:13:24
luv_php-22204.jpg
This is my file to show data
😎 2020-08-07 08:13:32
This is all about
😎 2020-08-07 08:13:37
Please help me
😎 2020-08-07 08:13:43
Guys
😎 2020-08-07 08:15:38
If u any problem to understand please let me know
rohit267 2020-08-07 08:16:56
😎 2020-08-07 08:15:38
If u any problem to understand please let me know

what is your issue?

rohit267 2020-08-07 08:20:33
explain in a proper way
😎 2020-08-07 08:20:54
How
😎 2020-08-07 08:23:24
I try to explain this
First see the pic of all three table of dB
Then go coding pic follow series
1) profile.php where I Made a button which name is item view
😎 2020-08-07 08:24:55
Then custom.php where I create controller in this we have two functions first load data to profile table in my first laptop pic
😎 2020-08-07 08:27:06
Then second function I just send I’d to another page which name is items.php through the button click. I store is in variable $scope. Id and send
😎 2020-08-07 08:30:00
Then go third file item view file which name is item.php where I call function in ng-init=β€œload_item(β€œβ€˜.$id.’”);
😎 2020-08-07 08:31:10
In third one file I get is in $id variable and pass through function
😎 2020-08-07 08:31:54
And four file load_item.php
😎 2020-08-07 08:32:04
Where I write my query
😎 2020-08-07 08:32:54
I want to pass I’d through function() in fourth file
😎 2020-08-07 08:33:00
But how
😎 2020-08-07 08:33:40
I hope I try my best
rohit267 2020-08-07 08:35:45
😎 2020-08-07 08:32:54
I want to pass I’d through function() in fourth file

php function or js?

😎 2020-08-07 08:36:04
Function
😎 2020-08-07 08:36:12
Wait I send pic
rohit267 2020-08-07 08:36:27
😎 2020-08-07 08:36:04
Function

php function or JavaScript function

rohit267 2020-08-07 08:36:30
oh god
😎 2020-08-07 08:36:32
luv_php-22231.jpg

rohit267 2020-08-07 08:36:57
😎 2020-08-07 08:36:32

its correct

rohit267 2020-08-07 08:37:01
what’s the issue
😎 2020-08-07 08:37:48
But data is not showing in item. Php
rohit267 2020-08-07 08:38:20
any Angular guy help him please
😎 2020-08-07 08:40:41
luv_php-22236.jpg

😎 2020-08-07 08:41:12
See in inspector bar
😎 2020-08-07 08:44:43
I’d value is there but additional β€œβ€+ also there
|