WiseLoop

WiseLoop supports this item

Supported

14 comments found.

Hi,

Very useful Class!

a) I use Words Operations (uniqueWords), but is it possible to obtain only the words which have more than 4 characters for example ?

b) I also obtain [ ] => 1 or [ word] => 1

Would It be possible to use the function TRIM to remove spaces?

Thanks ! :)

Mick

Hello and thank you for buying,

a) I’m not so sure right now if this can be a very useful feature; I will wait a while and see if it will be any future requests of this. Meanwhile, you can parse the unique words array by yourself and filter the words by any length you want.

b) Yes you can use trim before doing any subsequent operations.

Cheers.

uniqueWords

Space gives a false value.

Example :

[ word] => 1 [word] => 1

Thanks !

Mick

Please give me an actual sample string, and the results that you are expecting when applying a certain operation or filter.

Thank you.

Hello,

It is difficult to give you an example. My data come from a database (obtained with a variable).

But, it is possible to use trim before your function filters the single words.

For example, line 915 : trim($caseSensitive) ?

I would like to obtain [word] => 2

Thanks !

Mick

It seems that it is

<li> Word,</li>

which gives [ word] => 1.

Does That give you an idea ?

Thanks !

Mick

When i run:
$str = new wlString('<li> Word,</li>');
$my->uniqueWords();
this is what I get:
Array
(
    [li] => 2
    [word] => 1
)
As far as I see, it is the correct result. I don’t see any problem here; or maybe I didn’t understand you? As I have asked you before, in order to help you, please give a sample string (even extracted from a database) that you think it will lead to incorrect results.

Thank you so much.

Hello,

PM sent,

Thank you

Hello,

I want to change ‘CK’ by ‘Calvin Klein’ in the following string : CK IN2U 150ml EDT BLACK Homme when i apply the replace function

I have : Calvin Klein IN2U 150ml EDT BLACalvin Klein Homme

I want : Calvin Klein IN2U 150ml EDT BLACK Klein Homme

Thank you

Hello and thank you for buying PHP Advanced String Classes.

Use substitute function like this:
$string = new wlString('CK IN2U 150ml EDT BLACK Homme');
$new = $string->substitute('CK ', 'Calvin Klein ', 1, true);
Check out the product documentation for more information.

Cheers.

Hello,

This is not really a solution, because it will replace just the first occurrence, it will not work with :

Parfum Black CK IN2U 150ml EDT Homme ck

I need a function wich replace a whole word !

Thank you

Hmm, this is tricky because the script doesn’t (can’t) know wich of the ‘CK’ represents a brand name. Anyway, assuming that ‘CK’ is a word you can do this:
$string = new wlString('Parfum Black CK IN2U 150ml EDT Homme ck');
$new = $string->replace(' CK ', ' Calvin Klein ', false);
If the product starts or ends with the brand abbreviation do something like this:
$product = 'CK IN2U 150ml EDT Homme ck';
$string = new wlString(' ' . $product . ' ');
$new = $string->replace(' CK ', ' Calvin Klein ', false)->trimBoth();
Note that I added whitespaces to ensure that even we have brand abrevs at the beginning or end the string ’ CK ’ will be founded. This last solution is better; it covers more situations.

Cheers.

Nice script!

How does it works with foreign characters?

is ‘Trípode G5’ result to isAlpha() true or false, (accented ‘i’)

is there a class that will take all the accented characters and parse them as regular 26 alphabet char?

Thanks for your answer.

Hello,

isAplha() for ‘Trípode G5’ will return false because of the digit ‘5’; but isAlphaNumeric() should return true.

The alphabet is customizable by specifying its regular letters (chars) using a constant defined in the class configuration file. So if you want that some foreign chars to be considered as regular, just put them in that constant.

Cheers.

Hello, I have to extract “All Adult Costumes” from “All Adult Costumes > Around the World > American from” What function i can use ? Thank you

Hello and thank you for buying!
You can use the explode(’>’) function and get the first value from the returned array.
Cheers!

Curious to know if words can be added to the spell checking dictionary?

Hello,

Yes they can. Dictionary is stored inside a local text file.

Cheers!

hi! i find Advanced String Classes! and i wana buy it. i need function for grab substring of string where string much($str) and get result like this: 20charsstart+ $str + 20charsends, like your padBoth function but with chars from string

Hello,
This function not built in by default in the package but you can easily built your own using the already existing functions or even the PHP default string processing functions.
Good luck!

hi there! on your demo page errors! Warning: Something’s Not Right Here! codecanyon.net contains content from abdenago.cba.pl, a site known to distribute malware. Your computer might catch a virus if you visit this site.

Hello,
Thank you for notifying!
Right now I’m checking this issue with our provider because there is no way that we put it there even by mistake.
Thank you so much!

Hello again,
The past days our websites was under a serious attack and as a result it was infected with a malware. The site was successfully cured and everything is fine now. We’re very, very sorry for any inconvenience caused by this unwanted event.
Thank you for your patience and understanding.

Hi, if I wanted to use a recordset from Dreamweaver as part of the $my string, could you tell me if this is correct below please? Is the syntax correct for your software so I can show a property description with a trim on it?

$my = new wlString($row_rsResults[‘propertydetail_overview’]);

Thanks Mark

Hello and thank you for buying,
I’m not quite familiar with Dreamweaver recordsets but if $row_rsResults[‘propertydetail_overview’] is a PHP string, then it should work just fine.
Cheers!

Hi, Also, I cannot find the part about replacing ‘spaces’ in a seo friendly url for ‘hypens’ as advertised before I bought the script.

Could you please point me in the right direction.

Thanks Mark

Sorry, I’m a bit of a newbie on this coding thing. Can you give me an example of how to convert a url which is showing as ‘An example’ to get it to be ‘An-example’ as part of a url please?

Many thanks Mark

Here it is:
$str = new wlString("An example"); 
echo $str->seoFriendly();

Cheers!

many thanks for that! Cheers

Hi,

If I have the following code which pulls in a text from a database,

<?php require_once dirname(FILE).”/php-advanced-string-classes/bin/wlString.php”; $my = new wlString($row_rsFeaturedArtist[‘artists_about’]); echo $my->shorten(220,1); ?>

Is there a way of having the sentence end on a full word, instead of at the moment where it may end on the first letter of a word?

Many thanks Mark

Hello and thank you for buying,
This cannot be achieved out-of-the-box just by using shorten method. You have to implement your own logic that is considering full words; your implementation can use wordWrap, words methods.
If this will feature be requested by more users, we will consider to implement it in the next releases, until then you will have to use your own custom implementation.
Good luck!

by
by
by
by
by
by