Posts Tagged with string

Displaying 1-10 of 19 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: PHP compose class property by string and value
posted by admin on May 22, 2016
I have object or class.

class Class1{
public $language = "English";
public $languageru = "Russian";

public function composeValue(){
//return my value, or empty or "ru"
}
}

$class = new Class1();
$value = $class->composeValue();
// I want something like this
echo $class->language.$value
//But it is not working
Read more
Resolved: Get data from table from a list of strings on MySQL
posted by admin on May 6, 2016
How can I query data from a table available on a list of strings?

I only want to get the data from the list of strings.

Example:
Table
ID Name
1 Big
2 Small
3 Extra
4 Orange
5 Drink



List of Strings:
Big
Small
Extra
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: JavaScript replace or remove words from string using one function
posted by admin on April 23, 2016
I have string and I want to replace or remove words combination. Not one by one, not using

str = str.replace("green", "red");
str = str.replace("blue", "red")
etc...


I want something like

str.function("words combination", "red")
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: JavaScript get last characters from string. Get file extension from filename
posted by admin on April 9, 2016
I have file name, like
dad a d as da a d ad as d as d.jpg

I want to get file extension , the last three letters.Read 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