Hi, I want to replace ticks in text with other text. This method usually works, but when adding three dots, I get php warning ltrim(): Invalid '..'-range, no character to the right of '..' or invalid range needs to be incrementing. I don't know where to look for error, except deleting dots. Here is the code: $code = "some text before block ´´´´code block1´´´´ text after block ´´´´code block2...´´´´"; // I want ticks to be replaced to this: <pre><code> code block1 </code></pre> $pattern = "´´´´"; // we are using ticks $countCodeBlock = substr_count($code, $pattern); // count how many times pattern …

Member Avatar
Member Avatar
+0 forum 4

I have a large text string which is queried from a database. It can be several thousand words long. As of right now, when the search is run, it pulls all of the text and then prints the first 150 characters: [code] echo '<span class="line3">'. strip_tags(truncateText($sermontext, 150)) .'</span>'; [/code] The truncateText() function is as follows: [code] // return with no change if string is shorter than $limit if(strlen($string) <= $limit) return $string; // is $break present between $limit and the end of the string? if(false !== ($breakpoint = strpos($string, $break, $limit))) { if($breakpoint < strlen($string) - 1) { $string = …

Member Avatar
Member Avatar
+0 forum 2

Hi... Again :) Just after i fixed my previous problem thanks to me failing to put an echo before ".." I worked out that the incorrect image was showing. I'm making a stock trading website, and there will be an red arrow pointing downwards when it detects at - (negative sign). If it doesn't detect it, then it displays the green up arrow. Problem is, it is showing the green arrow for negative values, and the green arrow for positive values.... Here's the code : [CODE=php]<?php if($_SESSION['loggedin'] === "true") { ?> <?php include("includes/getstock.php"); ?> <br/> <br /> <?php $stockdata = …

Member Avatar
Member Avatar
+0 forum 4

The End.