当前位置: 首页>>代码示例>>PHP>>正文


PHP word_wrap函数代码示例

本文整理汇总了PHP中word_wrap函数的典型用法代码示例。如果您正苦于以下问题:PHP word_wrap函数的具体用法?PHP word_wrap怎么用?PHP word_wrap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了word_wrap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: openevent

function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $link_class = '', $pre_text = '', $post_text = '')
{
    global $cpath, $timeFormat, $dateFormat_week;
    # Strip all dollar signs from printable array entries; regex functions will mutilate them
    foreach ($arr as $key => $val) {
        $arr[$key] = str_replace('$', '$', $val);
    }
    $return = '';
    $event_text = stripslashes(urldecode($arr['event_text']));
    # build tooltip
    $title = makeTitle($arr, $time);
    # for iCal pseudo tag <http> comptability
    if (ereg('<([[:alpha:]]+://)([^<>[:space:]]+)>', $event_text, $matches)) {
        $full_event_text = $matches[1] . $matches[2];
        $event_text = $matches[2];
    } else {
        $full_event_text = $event_text;
        //$event_text = strip_tags($event_text, '<b><i><u><img>');
    }
    if (!empty($link_class)) {
        $link_class = ' class="' . $link_class . '"';
    }
    if (!empty($event_text)) {
        //$event_text=str_replace("\n","£",$event_text);
        $title = strip_tags(str_replace('<br />', "\n", $title));
        if ($lines > 0) {
            $event_text = word_wrap($event_text, $length, $lines);
        }
        if (!ereg('([[:alpha:]]+://[^<>[:space:]]+)', $full_event_text, $res) || $arr['description']) {
            $escaped_date = addslashes($event_date);
            $escaped_time = addslashes($time);
            $escaped_uid = addslashes($uid);
            $event_data = addslashes(serialize($arr));
            // fix for URL-length bug in IE: populate and submit a hidden form on click
            static $popup_data_index = 0;
            $return = "\n\t\t\t\t<script language='Javascript' type='text/javascript'><!--\n\t\t\t\tvar eventData = new EventData('{$escaped_date}', '{$escaped_time}', '{$escaped_uid}','{$cpath}','{$event_data}');\n\t\t\t\tdocument.popup_data[{$popup_data_index}] = eventData;\n\t\t\t\t// --></script>";
            $return .= '<a' . $link_class . ' title="' . $title . '" href="#" onclick="openEventWindow(' . $popup_data_index . '); return false;">';
            $popup_data_index++;
        } else {
            $return .= '<a' . $link_class . ' title="' . $title . '" href="' . $res[1] . '">';
        }
        $return .= $pre_text . $event_text . $post_text . '</a>' . "\n";
        //$return = str_replace("£","\n",$return);
    }
    return $return;
}
开发者ID:bilsan,项目名称:schedule-generator,代码行数:46,代码来源:date_functions.php

示例2: _parse_single

 public function _parse_single($key, $val, $string)
 {
     $newval = $val;
     $find = "/" . $this->l_delim . "" . $key . ".*" . $this->r_delim . "/U";
     preg_match($find, $string, $matches);
     if (!empty($matches)) {
         $temp = trim($matches[0], "{}");
         $res = explode(":", $temp);
         // var_dump($res);
         if (count($res) > 1) {
             switch ($res[1]) {
                 case "allcaps":
                     $newval = strtoupper($val);
                     break;
                 case "money":
                     $newval = number_format((int) $val, 2, ".", ",");
                     break;
                 case "caps":
                     $newval = ucwords(strtolower($val));
                     break;
                 case "nocaps":
                     $newval = strtolower($val);
                     break;
                 case "ucfirst":
                     $newval = ucfirst($val);
                     break;
                 case "bool1":
                     $newval = $val == 1 ? "True" : "False";
                     break;
                 case "bool2":
                     $newval = $val == 1 ? "Yes" : "No";
                     break;
                 case "bool3":
                     $newval = $val == 1 ? "Active" : "Inactive";
                     break;
                 case "climit":
                     $int = count($res) < 3 ? 128 : $res[2];
                     $newval = character_limiter($val, $int);
                     break;
                 case "htmlchars":
                     $newval = quotes_to_entities($val);
                     break;
                 case "wlimit":
                     $int = count($res) < 3 ? 25 : $res[2];
                     $newval = word_limiter($val, $int);
                     break;
                 case "wrap":
                     $int = count($res) < 3 ? 76 : $res[2];
                     $newval = word_wrap($val, $int);
                     break;
                 case "hilite":
                     $str = count($res) < 3 ? "" : $res[2];
                     $color = count($res) < 4 ? "#990000" : $res[3];
                     $newval = highlight_phrase($val, $str, "<span style=\"color:{$color}\">", "</span>");
                     break;
                 case "safe_mailto":
                     $alt_text = count($res) < 3 ? "" : $res[2];
                     $newval = safe_mailto($val, $alt_text);
                     break;
                 case "url_title":
                     $sep = count($res) < 3 ? "dash" : $res[2];
                     $newval = url_title($val, $sep);
                     break;
                 case "remove_img":
                     $newval = strip_image_tags($val);
                     break;
                 case "hash":
                     $hash = count($res) < 3 ? "md5" : $res[2];
                     $newval = dohash($val, $hash);
                     break;
                 case "stripslashes":
                     $newval = stripslashes($val);
                     break;
                 case "strip_tags":
                     $allowed = count($res) < 3 ? "" : $res[2];
                     $newval = strip_tags($val, $allowed);
                     break;
                     /** other output string format options here **/
             }
             return str_replace($matches[0], $newval, $string);
         }
     }
     return parent::_parse_single($key, $val, $string);
 }
开发者ID:silentworks,项目名称:vaspasian,代码行数:84,代码来源:Vaspasian_Parser.php

示例3: openevent

function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, $post_text, $link_class, $url)
{
    $event_text = stripslashes(urldecode($arr["event_text"]));
    # for iCal pseudo tag <http> comptability
    if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>", $event_text, $matches)) {
        $full_event_text = $matches[1] . $matches[2];
        $event_text = $matches[2];
    } else {
        $full_event_text = $event_text;
        $event_text = strip_tags($event_text, '<b><i><u>');
    }
    if (isset($arr["organizer"])) {
        $organizer = addslashes($arr["organizer"]);
    }
    if (isset($arr["attendee"])) {
        $attendee = addslashes($arr["attendee"]);
    }
    if (isset($arr["location"])) {
        $location = addslashes($arr["location"]);
    }
    if (isset($arr["status"])) {
        $status = addslashes($arr["status"]);
    }
    if (isset($arr["description"])) {
        $description = addslashes(stripslashes(urldecode($arr["description"])));
    }
    if (isset($arr["url"])) {
        $url = addslashes(stripslashes(urldecode($arr["url"])));
    }
    if (!empty($event_text)) {
        if ($lines > 0) {
            $event_text = word_wrap($event_text, $wrap, $lines);
        }
        if (!ereg("([[:alpha:]]+://[^<>[:space:]]+)", $full_event_text, $res) || $description) {
            $escaped_event = addslashes($full_event_text);
            $escaped_calendar = addslashes($calendar_name);
            $escaped_start = addslashes($start);
            $escaped_end = addslashes($end);
            // fix for URL-length bug in IE: populate and submit a hidden form on click
            static $popup_data_index = 0;
            echo <<<END

    <script language="Javascript" type="text/javascript"><!--
    var eventData = new EventData('{$escaped_event}', '{$escaped_calendar}', '{$escaped_start}', '{$escaped_end}', '{$description}', '{$status}', '{$location}', '{$organizer}', '{$attendee}', '{$url}');
    document.popup_data[{$popup_data_index}] = eventData;
    // --></script>

END;
            echo '<a class="' . $link_class . '" href="#" onclick="openEventWindow(' . $popup_data_index . '); return false;">';
            $popup_data_index++;
        } else {
            echo '<a class="' . $link_class . '" href="' . $res[1] . '">';
        }
        echo $pre_text . $event_text . $post_text . '</a>' . "\n";
    }
}
开发者ID:karl,项目名称:monket-calendar,代码行数:56,代码来源:date_functions.php

示例4: current_url

<div class="body" style="padding-left:20px">
	
	<!--getting the current url-->
	<?php 
//returns current url as string
$data = current_url();
$data2 = word_wrap($data, 100);
//replacing slaches with dashes in url
$data2 = str_replace('/', '-', $data);
?>
	
	<!--javascript confirm box for confirming bookmard adding-->
	<script type="text/javascript">
	function confirmBookmark()
	{
	     var r=confirm("Do you really want to Bookmark This Ad?")
	    if (r==true)
	      return true;
	    else
	      return false;
	}
	</script>
	<!--end of cinfirm box-->
	
	<!--form for bookmark keyword and button-->
	<form action ="<?php 
echo site_url('Full_ads/bookmarking/' . $data2);
?>
" method="post" id="search-form_3" onsubmit="return(confirmBookmark());">
		<?php 
echo form_error('bkmark');
开发者ID:Sanjula007,项目名称:Vehicle_portal,代码行数:31,代码来源:Bookmark_btn.php

示例5: get_vtodo

 function get_vtodo()
 {
     global $template, $getdate, $master_array, $next_day, $timeFormat, $tomorrows_events_lines, $show_completed, $show_todos;
     preg_match("!<\\!-- switch show_completed on -->(.*)<\\!-- switch show_completed off -->!is", $this->page, $match1);
     preg_match("!<\\!-- switch show_important on -->(.*)<\\!-- switch show_important off -->!is", $this->page, $match2);
     preg_match("!<\\!-- switch show_normal on -->(.*)<\\!-- switch show_normal off -->!is", $this->page, $match3);
     $completed = trim($match1[1]);
     $important = trim($match2[1]);
     $normal = trim($match3[1]);
     $nugget2 = '';
     if (is_array($master_array['-2'])) {
         foreach ($master_array['-2'] as $vtodo_times) {
             foreach ($vtodo_times as $val) {
                 $vtodo_text = stripslashes(urldecode($val["vtodo_text"]));
                 if ($vtodo_text != "") {
                     if (isset($val["description"])) {
                         $description = stripslashes(urldecode($val["description"]));
                     } else {
                         $description = "";
                     }
                     $completed_date = $val['completed_date'];
                     $event_calna = $val['calname'];
                     $status = $val["status"];
                     $priority = $val['priority'];
                     $start_date = $val["start_date"];
                     $due_date = $val['due_date'];
                     $vtodo_array = array('cal' => $event_calna, 'completed_date' => $completed_date, 'description' => $description, 'due_date' => $due_date, 'priority' => $priority, 'start_date' => $start_date, 'status' => $status, 'vtodo_text' => $vtodo_text);
                     $vtodo_array = base64_encode(serialize($vtodo_array));
                     $vtodo_text = word_wrap(strip_tags(str_replace('<br />', ' ', $vtodo_text), '<b><i><u>'), 21, $tomorrows_events_lines);
                     $data = array('{VTODO_TEXT}', '{VTODO_ARRAY}');
                     $rep = array($vtodo_text, $vtodo_array);
                     // Reset this TODO's category.
                     $temp = '';
                     if ($status == 'COMPLETED' || isset($val['completed_date']) && isset($val['completed_time'])) {
                         if ($show_completed == 'yes') {
                             $temp = $completed;
                         }
                     } elseif (isset($val['priority']) && $val['priority'] != 0 && $val['priority'] <= 5) {
                         $temp = $important;
                     } else {
                         $temp = $normal;
                     }
                     // Do not include TODOs which do not have the
                     // category set.
                     if ($temp != '') {
                         $nugget1 = str_replace($data, $rep, $temp);
                         $nugget2 .= $nugget1;
                     }
                 }
             }
         }
     }
     // If there are no TODO items, completely hide the TODO list.
     if ($nugget2 == '' || $show_todos != 'yes') {
         $this->page = preg_replace('!<\\!-- switch vtodo on -->(.*)<\\!-- switch vtodo off -->!is', '', $this->page);
     } else {
         $this->page = preg_replace('!<\\!-- switch show_completed on -->(.*)<\\!-- switch show_normal off -->!is', $nugget2, $this->page);
     }
 }
开发者ID:jbogota,项目名称:blog-king,代码行数:59,代码来源:template.php

示例6: test_default_word_wrap_charlim

 public function test_default_word_wrap_charlim()
 {
     $string = "Here is a longer string of text that will help us demonstrate the default charlim of this function.";
     $this->assertEquals(strpos(word_wrap($string), "\n"), 73);
 }
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:5,代码来源:text_helper_test.php

示例7: word_wrap

<?php

function word_wrap($string, $lineWidth)
{
    $exploded = explode(' ', $string);
    $spaceWidth = 1;
    $spaceLeft = $lineWidth;
    $currentLine = '';
    $results = array();
    for ($i = 0; $i < count($exploded); $i++) {
        $word = $exploded[$i];
        if (strlen($word) + $spaceWidth > $spaceLeft) {
            $exploded[$i] = '<br>' . $word;
            $spaceLeft = $lineWidth - strlen($word);
            $results[] = $currentLine;
            $currentLine = '';
        } else {
            $spaceLeft = $spaceLeft - (strlen($word) + $spaceWidth);
            $currentLine = $currentLine . ' ' . $word;
        }
    }
    return $results;
    //return implode(' ', $exploded);
}
word_wrap("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris condimentum eleifend massa vitae auctor. Suspendisse vel consectetur elit. Maecenas facilisis, justo ac suscipit faucibus, odio turpis laoreet est, eget suscipit diam tortor vulputate erat.", 50);
开发者ID:AUCSC,项目名称:news,代码行数:25,代码来源:wordwrap.php

示例8: format_field

function format_field($value, $type, $ticket = NULL)
{
    global $CONFIG;
    global $AppUI;
    global $canEdit;
    switch ($type) {
        case "user":
            if ($value) {
                $output = query2result("SELECT CONCAT_WS(' ',contact_first_name,contact_last_name) as name FROM users u LEFT JOIN contacts ON u.user_contact = contact_id WHERE user_id = '{$value}'");
            } else {
                $output = "-";
            }
            break;
        case "status":
            if ($canEdit) {
                $output = create_selectbox("type_toggle", array("Open" => $AppUI->_("Open"), "Processing" => $AppUI->_("Processing"), "Closed" => $AppUI->_("Closed"), "Deleted" => $AppUI->_("Deleted")), $value);
            } else {
                $output = chooseSelectedValue("type_toggle", array("Open" => $AppUI->_("Open"), "Processing" => $AppUI->_("Processing"), "Closed" => $AppUI->_("Closed"), "Deleted" => $AppUI->_("Deleted")), $value);
            }
            break;
        case "priority_view":
            $priority = $CONFIG["priority_names"][$value];
            $color = $CONFIG["priority_colors"][$value];
            if ($value == 3) {
                $priority = "<strong>{$priority}</strong>";
            }
            if ($value == 4) {
                $priority = "<blink><strong>{$priority}</strong></blink>";
            }
            $output = "<font color=\"{$color}\">{$priority}</font>";
            break;
        case "priority_select":
            if ($canEdit) {
                $output = create_selectbox("priority_toggle", $CONFIG["priority_names"], $value);
            } else {
                $output = chooseSelectedValue("priority_toggle", $CONFIG["priority_names"], $value);
            }
            break;
        case "assignment":
            $options[0] = "-";
            $query = "SELECT user_id as id, CONCAT_WS(' ',contact_first_name,contact_last_name) as name FROM users u LEFT JOIN contacts ON u.user_contact = contact_id ORDER BY name";
            $result = do_query($query);
            while ($row = result2hash($result)) {
                $options[$row["id"]] = $row["name"];
            }
            if ($canEdit) {
                $output = create_selectbox("assignment_toggle", $options, $value);
            } else {
                $output = chooseSelectedValue("assignment_toggle", $options, $value);
            }
            break;
        case "view":
            if ($CONFIG["index_link"] == "latest") {
                $latest_value = query2result("SELECT ticket FROM tickets WHERE parent = '{$value}' ORDER BY ticket DESC LIMIT 1");
                if ($latest_value) {
                    $value = $latest_value;
                }
            }
            $output = "<a href=index.php?m=ticketsmith&a=view&ticket={$value}>{$value}&nbsp;";
            $output .= "<img src=images/icons/pencil.gif border=0></a>";
            break;
        case "attach":
            $output = "<A href=index.php?m=ticketsmith&a=attach&ticket={$value}>";
            $output .= "Link</a>";
            break;
        case "doattach":
            $output = "<A href=index.php?m=ticketsmith&a=attach&newparent={$value}&dosql=reattachticket&ticket={$ticket}>";
            $output .= "Link</a>";
            break;
        case "open_date":
            $output = get_time_ago($value);
            if ($CONFIG["warning_active"]) {
                if (time() - $value > $CONFIG["warning_age"] * 3600) {
                    $output = "<font color=\"" . $CONFIG["warning_color"] . "\"><xb>" . $output . "</strong></font>";
                }
            }
            break;
        case "activity_date":
            if (!$value) {
                $output = "<em>" . $AppUI->_('none') . "</em>";
            } else {
                $output = get_time_ago($value);
            }
            $latest_followup_type = query2result("SELECT type FROM tickets WHERE parent = '{$ticket}' ORDER BY timestamp DESC LIMIT 1");
            if ($latest_followup_type) {
                $latest_followup_type = preg_replace("/(\\w+)\\s.*/", "\\1", $latest_followup_type);
                $output .= " [{$latest_followup_type}]";
            }
            break;
        case "elapsed_date":
            $output = date($CONFIG["date_format"], $value);
            $time_ago = get_time_ago($value);
            $output .= " <em>({$time_ago})</em>";
            break;
        case "body":
            if ($CONFIG["wordwrap"]) {
                $value = word_wrap($value, 78);
            }
            $value = htmlspecialchars($value);
            $output = "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"10\">\n";
//.........这里部分代码省略.........
开发者ID:hightechcompany,项目名称:dotproject,代码行数:101,代码来源:common.inc.php

示例9: stripslashes

 $vtodo_text = stripslashes(urldecode($val["vtodo_text"]));
 if ($vtodo_text != "") {
     if (isset($val["description"])) {
         $description = urldecode($val["description"]);
     } else {
         $description = "";
     }
     $completed_date = $val['completed_date'];
     $event_calna = $val['calname'];
     $status = $val["status"];
     $priority = $val['priority'];
     $start_date = $val["start_date"];
     $due_date = $val['due_date'];
     $vtodo_array = array('cal' => $event_calna, 'completed_date' => $completed_date, 'description' => $description, 'due_date' => $due_date, 'priority' => $priority, 'start_date' => $start_date, 'status' => $status, 'vtodo_text' => $vtodo_text);
     $vtodo_array = base64_encode(serialize($vtodo_array));
     $vtodo_text = word_wrap(strip_tags(str_replace('<br>', ' ', $vtodo_text), '<b><i><u>'), 21, $tomorrows_events_lines);
     $vtodo_link = "<a class=\"psf\" href=\"javascript:openTodoInfo('{$vtodo_array}')\">";
     if ($status == 'COMPLETED' || isset($val['completed_date']) && isset($val['completed_time'])) {
         if ($show_completed == 'yes') {
             $vtodo_text = "<S>{$vtodo_text}</S>";
             echo "<tr><td>{$vtodo_link}<img src=\"images/completed.gif\" alt=\" \" width=\"13\" height=\"11\" border=\"0\" align=\"middle\"></a></td>\n";
             echo "<td><img src=\"images/spacer.gif\" width=\"2\" height=\"1\" border\"0\" /></td><td>{$vtodo_link}<font class=\"G10B\"> {$vtodo_text}</font></a></td></tr>\n";
         }
     } elseif (isset($val['priority']) && $val['priority'] != 0 && $val['priority'] <= 5) {
         echo "<tr><td>{$vtodo_link}<img src=\"images/important.gif\" alt=\" \" width=\"13\" height=\"11\" border=\"0\" align=\"middle\"></a></td>\n";
         echo "<td><img src=\"images/spacer.gif\" width=\"2\" height=\"1\" border\"0\" /></td><td>{$vtodo_link}<font class=\"G10B\"> {$vtodo_text}</font></a></td></tr>\n";
     } else {
         echo "<tr><td>{$vtodo_link}<img src=\"images/not_completed.gif\" alt=\" \" width=\"13\" height=\"11\" border=\"0\" align=\"middle\"></a></td>\n";
         echo "<td><img src=\"images/spacer.gif\" width=\"2\" height=\"1\" border\"0\" /></td><td>{$vtodo_link}<font class=\"G10B\"> {$vtodo_text}</font></a></td></tr>\n";
     }
 }
开发者ID:dalinhuang,项目名称:sutoj,代码行数:31,代码来源:sidebar.php

示例10: text_helper

 public function text_helper()
 {
     $this->load->helper('text');
     $string = "Here is a nice text string consisting of eleven words.";
     $string = word_limiter($string, 4, "...");
     $this->htmlp($string);
     $string = "Here is a nice text string consisting of eleven words.";
     $string = character_limiter($string, 20, "...");
     $this->htmlp($string);
     $string = ascii_to_entities($string);
     $this->htmlp($string);
     $string = convert_accented_characters($string);
     $this->htmlp($string);
     $string = "darn shit sucks dinner";
     $disallowed = array('darn', 'shucks', 'golly', 'phooey');
     $string = word_censor($string, $disallowed, 'Beep!');
     $this->htmlp($string);
     $string = highlight_code($string);
     $this->htmlp($string);
     $string = "Here is a nice text string about nothing in particular.";
     $this->htmlp(highlight_phrase($string, "nice text", '<span style="color:#990000;">', '</span>'));
     $string = "Here is a simple string of text that will help us demonstrate this function.";
     $this->htmlp(word_wrap($string, 25));
     $str = 'this_string_is_entirely_too_long_and_might_break_my_design.jpg';
     $this->htmlp(ellipsize($str, 32, 0.5));
 }
开发者ID:jaffarsolo,项目名称:ci3-examples,代码行数:26,代码来源:Helpers.php

示例11: foreach

                                    <th>Phone</th>
                                    <th>Name</th>
                                    <th>Message</th>
                                    <th>status</th>
                                    <th>Registered</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                                <?php 
if (isset($testimonies)) {
    foreach ($testimonies as $testimony) {
        $icon = $testimony['status'] == 0 ? '<span><i class="material-icons red-text">error</i></span>' : '<span><i class="material-icons blue-text">verified_user</i></span>';
        echo '<tr>
                                        <td>' . $testimony['phone'] . '</td>
                                        <td>' . $testimony['name'] . '</td>
                                        <td>' . word_wrap($testimony['message']) . '</td>
                                        <td>' . $icon . '</td>
                                        <td>' . $testimony['dateadd'] . '</td>
                                        <td><a href="' . site_url('home/actiontestimony/confirm/' . $testimony['id']) . '" title="confirm and publish testimony"><i class="material-icons blue-text">done_all</i></a>
                                        <a href="' . site_url('home/actiontestimony/refute/' . $testimony['id']) . '" title="Refuse and delete testimony"><i class="material-icons red-text">delete_forever</i></a>
                                        </td>
                                    </tr>';
        ?>
                                <?php 
    }
}
?>
                        </table>   
                    </div>
                </div>
        </div>
开发者ID:larrytech7,项目名称:cog,代码行数:31,代码来源:testimonies.php

示例12: erzeuge_umbruch

function erzeuge_umbruch($text, $breite)
{
    //bricht text nach breite zeichen um
    if (strstr($text, "&gt;&nbsp;")) {
        // Alte Version für Quotes beibehalten
        //text in feld einlesen mit \n als trennzeichen
        $arr_text = explode("\n", $text);
        //fuer jeden Feldeintrag Zeilenumbruch hinzufuegen
        while (list($k, $zeile) = @each($arr_text)) {
            //nur Zeilen umbrechen die nicht gequotet sind
            if (!strstr($zeile, "&gt;&nbsp;")) {
                $arr_text[$k] = wordwrap($zeile, $breite, "\n", 0);
            }
        }
        return implode("\n", $arr_text);
    } else {
        // neue version, verhaut die umbrüche nicht mehr
        $text = word_wrap($text, $breite, $returns = "AUTO", $spacer = "", $joiner = ' ');
        return $text;
    }
}
开发者ID:netzhuffle,项目名称:mainchat,代码行数:21,代码来源:functions-community.php

示例13: testWordWrap

 public function testWordWrap()
 {
     $output = word_wrap('The quick brown fox jumps over the lazy dog.', 15);
     $this->assertRegExp('/lazy dog/', $output);
 }
开发者ID:groovey,项目名称:support,代码行数:5,代码来源:HelperCustomTest.php

示例14: openevent

function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $link_class = '', $pre_text = '', $post_text = '')
{
    global $cpath, $master_array;
    $event_text = stripslashes(urldecode($arr["event_text"]));
    if (empty($start)) {
        $title = $event_text;
    } else {
        $title = $arr['event_start'] . ' - ' . $arr['event_end'] . ': ' . $event_text;
    }
    # for iCal pseudo tag <http> comptability
    if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>", $event_text, $matches)) {
        $full_event_text = $matches[1] . $matches[2];
        $event_text = $matches[2];
    } else {
        $full_event_text = $event_text;
        $event_text = strip_tags($event_text, '<b><i><u><img>');
    }
    if (!empty($event_text)) {
        if ($lines > 0) {
            $event_text = word_wrap($event_text, $length, $lines);
        }
        if (!ereg("([[:alpha:]]+://[^<>[:space:]]+)", $full_event_text, $res) || $arr['description']) {
            $escaped_date = addslashes($event_date);
            $escaped_time = addslashes($time);
            $escaped_uid = addslashes($uid);
            $event_data = addslashes(serialize($master_array[$event_date][$time][$uid]));
            // fix for URL-length bug in IE: populate and submit a hidden form on click
            static $popup_data_index = 0;
            $return = "\n    <script language=\"Javascript\" type=\"text/javascript\"><!--\n    var eventData = new EventData('{$escaped_date}', '{$escaped_time}', '{$escaped_uid}','{$cpath}','{$event_data}');\n    document.popup_data[{$popup_data_index}] = eventData;\n    // --></script>";
            $return .= '<a class="' . $link_class . '" title="' . $title . '" href="#" onclick="openEventWindow(' . $popup_data_index . '); return false;">';
            $popup_data_index++;
        } else {
            $return .= '<a class="' . $link_class . '" title="' . $title . '" href="' . $res[1] . '">';
        }
        $return .= $pre_text . $event_text . $post_text . '</a>' . "\n";
    }
    return $return;
}
开发者ID:jbogota,项目名称:blog-king,代码行数:38,代码来源:date_functions.php

示例15: site_url

								  <td scope="col"><a href="<?php 
        echo site_url();
        ?>
admin/clientservices/<?php 
        echo $clist['clientId'];
        ?>
/notall"><?php 
        echo $clist['userName'];
        ?>
</a></td>
								  <td scope="col"><?php 
        echo $clist['serviceName'];
        ?>
</td>
								  <td scope="col"><?php 
        echo word_wrap($clist['serviceDescription'], 76);
        //echo wordwrap($clist['serviceDescription'], 20, "\n", true);
        ?>
</td>
								  <td scope="col"><?php 
        echo $clist['startingDate'];
        ?>
</td>
								  <td scope="col"><?php 
        echo $clist['endingDate'];
        ?>
</td>
								  <td scope="col">
									  <select class="selActions" id="<?php 
        echo $clist['id'];
        ?>
开发者ID:ricain59,项目名称:fortaff,代码行数:31,代码来源:clientservices.php


注:本文中的word_wrap函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。