substr

    1熱度

    2回答

    我的網址爲WordPress的帖子是這樣的: http://localhost:8888/blabla/book/yes-vi-testar 使用the_permalink()會產生「http://localhost:8888/blabla/book/yes-vi-testar」但我想剪頭34個字符來得到這樣一個字符串「是-VI-testar」。如何在這種情況下使用php substr?我很困惑.

    1熱度

    4回答

    我用下面的代碼進行修邊的標題,並顯示recent posts section我blog: <?php global $post; $releaseDate = get_post_meta($post->ID, "gosterim_tarihi", true); foreach($images as $image) { $title = get_the_title(); if

    2熱度

    3回答

    我想用C++在我創建的字符串類中創建substr方法。 字符串類當然是基於C風格的字符串,我會照顧內存管理。 我想寫一個substr(start, length)功能,可以在常規的工作方式:在這種方式 CustomString mystring = "Hello"; cout << mystring.substr(0,2); // will print "He" 而且也: mystring

    12熱度

    13回答

    我在變量中有以下字符串。 Stack Overflow is as frictionless and painless to use as we could make it. 我想先28個字符從上面的行提取,因此通常如果我用substr然後它會給我Stack Overflow is as frictio這個輸出,但我想輸出: Stack Overflow is as... 是否有任

    0熱度

    3回答

    $string = "This is my page content. This text will be paginated."; $pageNo = "0"; $pieceLength = "12"; $preparedForPrint = substr($string,$pageNo,$pieceLength); 我想要做的是,如果12字符是一個字內(第12字符不是一個空格),我

    1熱度

    5回答

    我的變量$var的形式爲'abc.de'。這是什麼SUBSTR正是做這一說法: $convar = substr($var,0,index(".",$var));

    24熱度

    7回答

    當我使用substr()我在最後 $articleText = substr($articleText,0,500); 得到一個奇怪的角色,我有500個字符的輸出和< - 我怎樣才能解決這個問題?這是一個編碼問題嗎?我的語言是希臘語。

    1熱度

    6回答

    我目前使用str_replace函數刪除usrID和緊隨其後的 '逗號': 例如: $usrID = 23; $string = "22,23,24,25"; $receivers = str_replace($usrID.",", '', $string); //Would output: "22,24,25" 不過,我已經注意到,如果: $usrID = 25; //or the La

    3熱度

    2回答

    我使用mb_substr函數來切分帶有變音符號的unicode字符串,但它的工作原理與我使用簡單的substr函數一樣。它將unicode字符分成一半顯示問題標記的鑽石。 E.g. 什麼可能是錯誤的?

    1熱度

    3回答

    我需要能夠獲取數字的最後一位數字。 即我需要2從返回:12. 這樣在PHP:$minute = substr(date('i'), -1)但我需要這在Python。 任何想法