PHP Japanese string helper functions for converting Japanese strings from full-width to half-width and reverse. Laravel Rule for validation Japanese string only full-width or only half-width.

Overview

Japanese String Helpers

PHP Japanese string helper functions for converting Japanese strings from full-width to half-width and reverse.
Laravel Rule for validation Japanese string only full-width or only half-width.

Installation

  1. You can install the package via composer:
composer require deha-soft/jp-string-helper
  1. Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
'providers' => [
    // ...
    DehaSoft\JpStringHelper\JpStrRulesServiceProvider::class,
];

Usage

Example use of the toHalfSize, toFullSize helper.

>> 12345ザヂプabcd $halfSizeStr = "12345ザヂプabcd"; $output = Transform::toFullSize($halfSizeStr); echo $output; >>> 12345ザヂプabcd">
# using Transform import
use DehaSoft\JpStringHelper\Transform;

$fullSizeStr = "12345ザヂプabcd";
$output = Transform::toHalfSize($fullSizeStr);
echo $output;
>>> 12345ザヂプabcd

$halfSizeStr = "12345ザヂプabcd";
$output = Transform::toFullSize($halfSizeStr);
echo $output;
>>> 12345ザヂプabcd

Example use of the Rule for Laravel validation.

# using Rule class import
use DehaSoft\JpStringHelper\Rules\FullSize;
use DehaSoft\JpStringHelper\Rules\HalfSize;

public function rules()
{
    return [
        'name' => [new FullSize()],
        'description' => [new HalfSize()],
    ];
}
# or using rule alias

public function rules()
{
    return [
        'name' => ['full_size'],
        'description' => ['half_size'],
    ];
}

License

The MIT License (MIT). Please see License File for more information.

You might also like...
ICSGenerator - The module can generate basic ICS calendar strings and files

ICSGenerator The module can generate basic ICS calendar strings and files. The module simply extends WireData. It has these properties and default val

Parse DSN strings into value objects to make them easier to use, pass around and manipulate

DSN parser Parse DSN strings into value objects to make them easier to use, pass around and manipulate. Install Via Composer composer require nyholm/d

PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.
PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.

forceutf8 PHP Class Encoding featuring popular \ForceUTF8\Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strin

PHP class for parsing user agent strings (HTTP_USER_AGENT).

PHP class for parsing user agent strings (HTTP_USER_AGENT). Includes mobile checks, bots and banned bots checks, browser types/versions and more. Based on browscap (via phpbrowscap), Mobile_Detect and ua-parser. Created for high traffic websites and fast batch processing.

Decimal handling as value object instead of plain strings.

Decimal Object Decimal value object for PHP. Background When working with monetary values, normal data types like int or float are not suitable for ex

Create executable strings using a fluent API.

command-builder A PHP class to build executable with using fluent API. Summary About Features Installation Examples Compatibility table Tests About I

A comprehensive library for generating differences between two strings in multiple formats (unified, side by side HTML etc). Based on the difflib implementation in Python

PHP Diff Class Introduction A comprehensive library for generating differences between two hashable objects (strings or arrays). Generated differences

Shortest Path - have a function ShortestPath (strArr) take strArr which will be an array of strings which models a non-looping Graph.

Have the function ShortestPath(strArr) take strArr which will be an array of strings which models a non-looping Graph

Laminas\Text is a component to work on text strings

laminas-text This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Releases(v0.0.1)
  • v0.0.1(Mar 18, 2022)

Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer.

php-cs-fixer-config Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer. Installation Run $ composer require --dev e

null 37 Jan 2, 2023
Contracts for Rule Doc Generator. Useful for production code with minimum dependencies.

Rule Doc Generator Contracts Contracts for Rule Doc Generator. Useful for production code with minimum dependencies. Install composer require symplify

null 19 Dec 22, 2022
SubRocks is a faithful recreation & reverse engineering effort for 2012 YouTube

subrocks-2012 a 2012 rewrite for subrocks SubRocks is a faithful recreation & reverse engineering effort for 2012 YouTube. You can visit the site at h

chief bazinga 9 Nov 19, 2022
Here is the top 100 PHP functions: it is the list of the most often used PHP native functions

Here is the top 100 PHP functions: it is the list of the most often used PHP native functions. If you are a PHP developer, you must know the Top 100 PHP Functions deeply.

Max Base 16 Dec 11, 2022
Magento-Functions - A Resource of Magento Functions

Magento-Functions A Resource of Magento Functions Table of Contents Category Product User Cart Checkout General Account [Working w/ URL's] (#urls) Cat

Bryan Littlefield 28 Apr 19, 2021
Php library for converting emoji shortcodes to emoji

Emojify provides methods for checking if string is shortcode replace shortcode with emoji replacing all shortcodes in string with emoji Made for a md

Neo Lejondahl 2 Oct 3, 2022
A PHP wrapper around Libreoffice for converting documents from one format to another.

Document Converter A PHP wrapper around Libreoffice for converting documents from one format to another. For example: Microsoft Word to PDF OpenOffice

Lukas White 0 Jul 28, 2022
PocketMine-MP Plugin for converting items & blocks name to your language.

ConvertName PocketMine-MP Plugin for converting items & blocks name to your language. Usage Due to license issue, I don't put the language files direc

null 6 Aug 25, 2022
laminas-xml2json provides functionality for converting XML structures to JSON

laminas-xml2json This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Stee

Laminas Project 13 Dec 28, 2022
Dobren Dragojević 6 Jun 11, 2023