Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mb_strimwidth(3) [php man page]

MB_STRIMWIDTH(3)							 1							  MB_STRIMWIDTH(3)

mb_strimwidth - Get truncated string with specified width

SYNOPSIS
string mb_strimwidth (string $str, int $start, int $width, [string $trimmarker = ""], [string $encoding = mb_internal_encoding()]) DESCRIPTION
Truncates string$str to specified $width. PARAMETERS
o $str - The string being decoded. o $start - The start position offset. Number of characters from the beginning of string. (First character is 0) o $width - The width of the desired trim. o $trimmarker - A string that is added to the end of string when string is truncated. o $encoding -The $encoding parameter is the character encoding. If it is omitted, the internal character encoding value will be used. RETURN VALUES
The truncated string. If $trimmarker is set, $trimmarker is appended to the return value. EXAMPLES
Example #1 mb_strimwidth(3) example <?php echo mb_strimwidth("Hello World", 0, 10, "..."); // outputs Hello W... ?> SEE ALSO
mb_strwidth(3), mb_internal_encoding(3). PHP Documentation Group MB_STRIMWIDTH(3)

Check Out this Related Man Page

MB_STRCUT(3)								 1							      MB_STRCUT(3)

mb_strcut - Get part of string

SYNOPSIS
string mb_strcut (string $str, int $start, [int $length = NULL], [string $encoding = mb_internal_encoding()]) DESCRIPTION
mb_strcut(3) extracts a substring from a string similarly to mb_substr(3), but operates on bytes instead of characters. If the cut position happens to be between two bytes of a multi-byte character, the cut is performed starting from the first byte of that character. This is also the difference to the substr(3) function, which would simply cut the string between the bytes and thus result in a malformed byte sequence. PARAMETERS
o $str - The string being cut. o $start - Starting position in bytes. o $length - Length in bytes. If omitted or NULL is passed, extract all bytes to the end of the string. o $encoding -The $encoding parameter is the character encoding. If it is omitted, the internal character encoding value will be used. RETURN VALUES
mb_strcut(3) returns the portion of $str specified by the $start and $length parameters. SEE ALSO
mb_substr(3), mb_internal_encoding(3). PHP Documentation Group MB_STRCUT(3)
Man Page

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to extract a sub-string from a string?

Can anyone help with my string editing problem? I need write a ksh script to extract a sub-string from a longer string. The sub-string will start wih the characters SPC and end with the ) character but I don't know in advance where in the main string these characters will appear or how long the... (4 Replies)
Discussion started by: JohnHealey
4 Replies

2. UNIX for Dummies Questions & Answers

access each character in a string

Hi All, I'm writing a script where one of the parameter is a string like: 0011001100 Then I want to do a while loop, according to the value of each character. Could tell how I can access the value of each character in the string? Thank you, Gino (6 Replies)
Discussion started by: f_o_555
6 Replies

3. UNIX for Dummies Questions & Answers

Deletion of starting commas

There is one question. I have a string(suppose $str). If it starts with a comma(there can be more than one comma at the start),I have to remove all the commas from the beginning.So i have to check if the string starts with a comma.If it does,I have to delete all the commas which are at the start of... (1 Reply)
Discussion started by: abhinavsinha
1 Replies

4. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

5. UNIX for Dummies Questions & Answers

Ps -ef, output getting truncated, please help

Hi All, here is an output of my command and the problem is that my output string is truncated, I want to exact the full string, I am on BASH shell, please help me out. Regards Rahul command with Output : lonss05903:cmdsvc01 /home/cmdsvc01 > ps -aef|grep 'Copy' cmdsvc01 2642 8675 ... (7 Replies)
Discussion started by: rahulkalra9
7 Replies

6. Shell Programming and Scripting

Need help to find total counts in a string

Suppose I have a string " 1 A B C D F 3 F G 3 1 D L D ". Please let me know the command which tells the above string having 3 Ds. echo $str | grep -c "D" It returns only 1 I know the reason but I am looking some command which should give 3. Actually I have a file, which I need to read... (5 Replies)
Discussion started by: sumitc
5 Replies

7. Shell Programming and Scripting

Find string in file and find the all records by string

Hello I would like to get know how to do this: I got a big file (about 1GB) and I need to find a string (for instance by grep ) and then find all records in this file based on a string. Thanks for advice. Martin (12 Replies)
Discussion started by: mape
12 Replies