Displaying 21-30 of 38 results.
Resolved: PHP remove same values from two arrays
posted by admin on April 5, 2016
I have two arrays
1.

$array1 = array("a" => "green", "red", "blue", "red");


2.

$array2 = array("b" => "green", "yellow", "red");


I want to compare values, and get new array with unique elements.
Result

Array
(
[1] => blue
)
Read more
Resolved: PHP remove duplicate elements from array - unique array
posted by admin on April 4, 2016
I have array

$input = array("a" => "green", "red", "b" => "green", "blue", "red");


I want compose unique array from my array, without same duplicate valuesRead more
Resolved: PHP reverse array
posted by admin on March 31, 2016
How to reverse my arrayRead more
Resolved: PHP date or datetime to Yesterday, Today
posted by admin on March 30, 2016
In my social website, I want to convert datetimes in format, like
Today
YesterdayRead more
Resolved: PHP trim my strings in array
posted by admin on March 27, 2016
I have array, and I want to trim my array elements
My array

$arr = array(" one", " two", " three ", ..., etc);
Read more
Resolved: PHP remove empty strings from array
posted by admin on March 27, 2016
I have array

$arr = array("one", "two", "", "four");


I want to remove empty string from array with indexRead more
Resolved: PHP Compose array from string, by comma and space
posted by admin on March 27, 2016
I have hashtags, and I want to compose array from my hashtags string. My hashtags format is

one, two, three, four, five, six, 0909090, ... etc
Read more
Resolved: PHP Regex Remove special chars, symbols from string, allow only comma and space
posted by admin on March 27, 2016
I have tags on my blog.
Tags format, which user write is like

one, two, three, four, five, six, seven, 11887, ... etc


I want to protect my tags, and exclude situations like

#asdad, asdsad#adsd, ***m,
Read more
Resolved: PHP replace words in string array without case sensitive
posted by admin on March 11, 2016
I want to replace words in array string, only single word, without contains in another word, only, when the word in format SPACE+WORD+SPACE.

For example

$string = ['Москва — город герой!', 'москва не резиновая', 'москватека не резиновая', 'текамоскватека не резиновая', 'текамосква не резиновая'];


I want to replace all "Москва", and "москва" to Moscow, and get result output like

Array ( [0] => Moscow — город герой! [1] => Moscow не резиновая [2] => москватека не резиновая [3] => текамоскватека не резиновая [4] => текамосква не резиновая )
Read more
Resolved: PHP value to boolean true or false convert
posted by admin on March 6, 2016
I have some value. I want convert it to boolean, if value is not empty or not NULL, return true, else return falseRead more