skybluesofa/hashtagify

Create hashtags from strings.

0.1.2.0 2018-07-13 20:00 UTC

This package is auto-updated.

Last update: 2024-03-20 01:03:10 UTC


README

Build Status Code Climate Test Coverage Total Downloads Version Software License

hashtagify

Um...make hashtags from strings

Usage:

You'll notice that these method names mirror the results that will be returned.

To generate lowercase hashtag:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::lowercase('The time is now!');
// "#thetimeisnow"
?>

To generate uppercase hashtag:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::UPPERCASE('The time is now!');
// "#THETIMEISNOW"
?>

To generate camelcase hashtag:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::camelCase('The time is now!');
// "#theTimeIsNow"
?>

To generate Pascal case hashtag:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::PascalCase('The time is now!');
// "#TheTimeIsNow"
?>

To generate hashtag using same case as what was entered:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::asIs('The time is now, Jim!');
// "#ThetimeisnowJim"
?>

To generate snake case hashtag with all words uppercased:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::Uppercase_Snake('The time is now!');
// "#The_Time_Is_Now"
?>

To generate snake case hashtag with all words lowercased:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::lowercase_snake('The time is now!');
// "#the_time_is_now"
?>

To generate snake case hashtag with all words uppercased, except the first, which is lowercased:

<?php
use Skybluesofa\Hashtagify;

echo Hashtagify::camelcase_Snake('The time is now!');
// "#the_Time_Is_Now"
?>