Skip to content

Tag: split

Match Country in String, split based on result

I have a CSV file with one of the fields holding state/country info, formatted like: “Florida United States” or “Alberta Canada” or “Wellington New Zealand” – not comma or tab delimited between them, simply space delimited. I have an array of all the potential countries as well. What I am looking for, is a solution that, in a loop, I

Retrieve data from the name of a directory in my database

I use php and laravel. I have a column named MsgBody. In this column, there is an array as follows. I want to get the value of “conversationDesc” from this array. What should I do in the Controller and blade part for this? Answer It seems that your data are JSON. You can decode this using json_decode. You should be

MySQL split table amounts based on another table information

I need to split amounts in a table (transactions) accord to another related table information (bill_details). Base table (transactions): ID amount document_id 1 100.00 11 2 80.00 12 3 120.00 13 Another table (bill_details): ID amount document_id description 1 20.00 11 A 2 60.00 11 B 3 20.00 11 C 4 80.00 12 D 5 60.00 13 E 6 20.00

Split 1 day array into 2 days array

I have an array like this and I want to split this into 2 arrays with the same date. I want to make 2 arrays with the same date, and it looks like this: How to make this happen? and my code looks like this, i tried to add variable for dates but its not works. And sometimes just showing

Format integer or string in php

sorry for a noob question but I am wondering if you could format strings in php with comma or dashes, something like this: Ex. #1 Ex. #2 If anyone could help me out, that would be appreciated. Answer You could use a regex replacement here:

php substr() and currency symbol strange output

This is a little bit rude code and I am having this output for this simple string formatting sample. $originalValue is equal for example to “$50.00”; $currency is setted correctly to “$”; $value should be “50.00” but this is the result of the above dd() is: b”£50.00″ ($originalValue is still the same even after the “mb_substr” operation) what I have