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。 任何想法