Posts Tagged with php string

Displaying 1-10 of 11 results.
Resolved: PHP fopen fwrite tab tabulation
posted by admin on April 18, 2017
I have code, where I create file and write string in that file
PHP:

$string = "Some text \t any text";
$handle = fopen($filename, 'w');
fwrite($handle, $string);
fclose($handle);

Output as same as I try to create

Some text \t any text
Read more
Resolved: PHP fopen fwrite new line
posted by admin on April 18, 2017
I have code, where I create file and write string in that file
PHP:

$string = "Some text \n any text \r\n more text \n\r";
$handle = fopen($filename, 'w');
fwrite($handle, $string);
fclose($handle);

Output as same as I try create

$string = "Some text \n any text \r\n more text \n\r";

How to write text in file with new line?Read more
Resolved: PHP get the first word of a sentence string
posted by admin on May 22, 2016
I want to extract the first word of a variable from a string. For example, take this input:

<?php $myvalue = 'Test me more'; ?>

The resultant output should be Test, which is the first word of the input. How can I do this?Read more
Resolved: Remove the last character(comma) from string
posted by admin on May 6, 2016
I have a string like

a,b,c,d,e,


I would like to remove last ',' and get the remaining string back

OUTPUT: a,b,c,d,e
Read more
Resolved: Yii get last parameter from current url without GET name getQuery
posted by admin on April 10, 2016
My controller

public function actionVideo()
{
//want to get last url parametr
}


My URL like

...video/12313213123/dubaivideos


I want to get dubaivideosRead 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